package cn.fl.expatriate.controller;

import cmm.comm.facade.framework.api.ISysCdMapApiService;
import cmm.comm.facade.framework.api.ISysDictionaryApiService;
import cmm.comm.facade.framework.condition.SysCdMapDQueryCondition;
import cmm.comm.facade.framework.dto.SysCdMapDDTO;
import cmm.comm.facade.framework.dto.SysDictionaryDTO;
import cmm.comm.facade.syssms.api.ISysSmsApiService;
import cmm.comm.facade.syssms.condition.SysSmsLogQueryCondition;
import cmm.comm.facade.syssms.constant.SysConTemplatesConstant;
import cmm.comm.facade.syssms.dto.SendContextDTO;
import cmm.comm.facade.syssms.dto.SysSmsLogDTO;
import cmm.mid.core.framework.dto.BaseParamDTO;
import cmm.mid.core.framework.dto.DataResultDTO;
import cmm.mid.core.framework.dto.tripartite.CreditDTO;
import cmm.mid.core.framework.page.KeyValueVO;
import cmm.web.core.framework.controller.BaseController;
import cn.cmm.base.framework.constant.BaseConstant;
import cn.cmm.base.framework.constant.BaseExceptionConstant;
import cn.cmm.base.framework.exception.BaseException;
import cn.cmm.base.framework.logger.eum.LogExceptionEnum;
import cn.cmm.base.framework.utils.*;
import cn.cmm.cache.framework.service.ICacheService;
import cn.cmm.cache.framework.utils.PropertiesCacheUtils;
import cn.fl.audit.constant.AudStandingBookConstant;
import cn.fl.audit.service.IAudCreditInfoService;
import cn.fl.audit.service.IAudInterviewInfoService;
import cn.fl.audit.service.IAudReturnVisitService;
import cn.fl.audit.service.IAudStandingBookService;
import cn.fl.audit.vo.AudCreditInfoVO;
import cn.fl.audit.vo.AudOpeLineVO;
import cn.fl.audit.vo.AudReturnVisitVO;
import cn.fl.capital.condition.CapPayeeInfoQueryCondition;
import cn.fl.capital.constant.CapitalConstant;
import cn.fl.capital.service.ICapPayInfoService;
import cn.fl.capital.service.ICapPayeeInfoService;
import cn.fl.capital.vo.CapPayInfoVO;
import cn.fl.capital.vo.CapPayeeInfoVO;
import cn.fl.commons.result.ResponseData;
import cn.fl.customer.service.ICstBscInfoService;
import cn.fl.customer.vo.CstBscInfoVO;
import cn.fl.expatriate.condition.ExpBizManRecQC;
import cn.fl.expatriate.service.IAdvBizRecService;
import cn.fl.expatriate.service.IExpBizManRecService;
import cn.fl.expatriate.vo.AdvBizRecVO;
import cn.fl.expatriate.vo.ExpBizManRecVO;
import cn.fl.framework.base.constant.WebBaseConstant;
import cn.fl.framework.base.context.CurrentThreadContext;
import cn.fl.framework.constant.DictionaryConstant;
import cn.fl.inscare.service.IInsApplicationStagingService;
import cn.fl.inscare.vo.InsApplicationVO;
import cn.fl.preloan.IAuditOpeLineService;
import cn.fl.preloan.condition.AuditCreditInfoQueryCondition;
import cn.fl.preloan.dto.audit.AuditOpeLineDTO;
import cn.fl.preloan.dto.audit.GetAudOpeLineByVisitIdRequest;
import cn.fl.project.api.IPrjBscExtApiService;
import cn.fl.project.condition.PrjPrdBscInfoQueryCondition;
import cn.fl.project.condition.PrjPrdDtlQueryCondition;
import cn.fl.project.condition.PrjPrdPaySchMQueryCondition;
import cn.fl.project.constant.*;
import cn.fl.project.dto.PrjBscExtDTO;
import cn.fl.project.dto.PrjPrdDtlDTO;
import cn.fl.project.service.*;
import cn.fl.project.vo.*;
import cn.fl.risk.service.IRskCstSignLogService;
import cn.fl.system.service.ISysInsTabCfgService;
import cn.fl.system.service.ISysRegionService;
import cn.fl.system.service.ISysUsrService;
import cn.fl.system.vo.SysInsTabCfgVO;
import cn.fl.system.vo.SysUsrVO;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import fl.customer.facade.customer.api.ICustomerQueryApiService;
import fl.customer.facade.customer.condition.CstBankQueryCondition;
import fl.customer.facade.customer.condition.CstNpBscInfoQueryCondition;
import fl.customer.facade.customer.dto.CstBankDTO;
import fl.customer.facade.customer.dto.CstNpBscInfoDTO;
import fl.flow.facade.flow.constant.FlowConstant;
import fl.inf.facade.api.IBFSApiService;
import fl.inf.facade.api.ITransLogApi;
import fl.inf.facade.condition.InfTransLogQueryCondition;
import fl.inf.facade.constant.InterfaceConstants;
import fl.inf.facade.dto.InfBfsPayDTO;
import fl.inf.facade.dto.InfTransLogDTO;
import fl.riskctrl.facade.externalinterface.service.api.IExternalAcardGpsApiService;
import fl.spl.facade.spl.api.ISplHRiskWarnRecApiService;
import fl.spl.facade.spl.condition.SplHRiskWarnRecQC;
import fl.spl.facade.spl.dto.SplHRiskWarnRecDTO;
import fl.tripartite.facade.api.ITripartiteApi;
import net.sf.json.JSONArray;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*;

/**
 * 垫款流程 控制层
 *
 * @projectName: fl
 * @package: cn.fl.expatriate.controller
 * @className: AdvBizFlowController
 * @author: liuqihao@lionbridgecapital.cn
 * @createDate: 2020-02-07 17:40
 * @version: V1.0.0
 * @copyright: (c)2020
 * @updateRemark: [序号][YYYY-MM-DD] [更改人姓名][变更描述]
 */
@Controller
@RequestMapping("/advBiz/flow")
public class AdvBizFlowController extends BaseController {

    @Autowired
    private IAdvBizRecService advBizRecService;

    @Autowired
    private ISysDictionaryApiService sysDictionaryApiService;

    @Autowired
    private IAudReturnVisitService audReturnVisitService;

    @Autowired
    private IPrjPrdPaySchMService prjPrdPaySchMService;

    @Autowired
    private IPrjPrdBscInfoService prjPrdBscInfoService;

    @Autowired
    private IPrjPrdDtlService prjPrdDtlService;

    @Autowired
    private IProjectApiService projectApiService;

    @Autowired
    private IPrjBscInfoService prjBscInfoService;

    @Autowired
    private ICapPayInfoService capPayInfoService;

    @Autowired
    private ICapPayeeInfoService capPayeeInfoService;

    @Autowired
    private ICustomerQueryApiService customerQueryApiService;

    @Autowired
    private IPrjBscExtApiService prjBscExtApiService;

    @Autowired
    IExternalAcardGpsApiService externalAcardGpsApiService;

    @Autowired
    private IInsApplicationStagingService insApplicationStagingService;

    @Autowired
    private ISplHRiskWarnRecApiService splHRiskWarnRecApiService;

    @Autowired
    private ICstBscInfoService cstBscInfoService;

    @Autowired
    private IPrjPrdMtgService prjPrdMtgService;

    @Autowired
    private IPrjPrdLicInfoService prjPrdLicInfoService;

    @Autowired
    private IBFSApiService bFSApiService;

    @Autowired
    private ITripartiteApi tripartiteApi;

    @Autowired
    private ITransLogApi transLogApi;

    @Autowired
    private IRskCstSignLogService rskCstSignLogService;

    @Autowired
    private ICacheService cacheService;

    @Autowired
    private IAudCreditInfoService audCreditInfoService;

    @Autowired
    private ISysRegionService sysRegionService;

    @Autowired
    private ISysInsTabCfgService sysInsTabCfgService;

    @Autowired
    private IAudStandingBookService audStandingBookService;

    @Autowired
    private IAudInterviewInfoService audInterviewInfoService;

    @Autowired
    private ISysSmsApiService sysSmsApiService;

    @Autowired
    private IAuditOpeLineService auditOpeLineService;

    @Autowired
    private IExpBizManRecService expBizManRecService;

    @Autowired
    private ISysUsrService sysUsrService;

    @Autowired
    private ISysCdMapApiService sysCdMapApiService;


    @RequestMapping(value = "/toAdditionalLoanPage.do", method = {RequestMethod.GET, RequestMethod.POST})
    public ModelAndView toAdditionalLoanPage(HttpServletRequest request, HttpServletResponse response, @RequestParam(required = false, defaultValue = "0") String isGpsNode) {
        // 垫款业务主键id
        String advBizRecId = request.getParameter("advBizRecId");
        AdvBizRecVO advBizRecVO = this.advBizRecService.selectById(Long.valueOf(advBizRecId));
        String dataTypCd = advBizRecVO.getDataTypCd();
        Long dataId = advBizRecVO.getDataId();
        ModelAndView view = null;
        if ("PRJ".equals(dataTypCd)) {
            // 项目
            view = this.loanToPrjPage(request, String.valueOf(dataId));
        }
        if ("CAP".equals(dataTypCd)) {
            // 付款
            view = this.toAdditionalAudit(request, isGpsNode, dataId);
        }
        String isAdvBiz = request.getParameter("isAdvBiz");
        view.addObject("isAdvBiz", isAdvBiz);
        return view;
    }

    @RequestMapping(value = "/toAdditionalAuditPage.do", method = {RequestMethod.GET, RequestMethod.POST})
    public ModelAndView toAdditionalAuditPage(HttpServletRequest request, HttpServletResponse response, @RequestParam(required = false, defaultValue = "0") String isGpsNode) {
        // 垫款业务主键id
        String advBizRecId = request.getParameter("advBizRecId");
        AdvBizRecVO advBizRecVO = this.advBizRecService.selectById(Long.valueOf(advBizRecId));
        String dataTypCd = advBizRecVO.getDataTypCd();
        Long dataId = advBizRecVO.getDataId();
        ModelAndView view = null;
        if ("PRJ".equals(dataTypCd)) {
            // 项目
            view = this.auditToPrjPage(request, String.valueOf(dataId));
        }
        if ("CAP".equals(dataTypCd)) {
            // 付款
            view = this.toAdditionalAudit(request, isGpsNode, dataId);
        }
        String isAdvBiz = request.getParameter("isAdvBiz");
        view.addObject("isAdvBiz", isAdvBiz);
        return view;
    }


    private ModelAndView loanToPrjPage(HttpServletRequest request, String prjId) {
//        String prjId = request.getParameter("advBizRecId");//业务主键(项目ID)
        String sysCd = CurrentThreadContext.getCurrentSysCd();
        String orgCd = CurrentThreadContext.getCurrentOrgCd();
        String isAuditNode = request.getParameter("isAuditNode");//是否信审节点标识

        String proIntId = request.getParameter("processInstanceId");//流程实例ID
        String taskId = request.getParameter("taskId");//任务ID
        String taskDefKey = request.getParameter("taskDefKey");//任务KEY
        String taskNm = request.getParameter("taskNm");//任务名称
        String EmergencyContact = request.getParameter("EmergencyContact");//紧急联系人标识
        String returnvisit = request.getParameter("returnvisit");//后续回访标识
        String procNm = request.getParameter("procNm");//流程名称
        String authNm = request.getParameter("authNm");//抵押权人名称
        String exposureSource = request.getParameter("exposureSource");//是否展示敞口
        String isNeedAddTime = request.getParameter("isNeedAddTime");// 设定交车日期 =1
        String assetCd = request.getParameter("assetCd");// 自动分配处理人
        ModelAndView view = new ModelAndView("capital/flowAdditionalInfo/payFlowAdditionalList");
        view.addObject("prjId", prjId);
        view.addObject("proIntId", proIntId);
        view.addObject("taskId", taskId);
        view.addObject("taskDefKey", taskDefKey);
        view.addObject("taskNm", taskNm);
        view.addObject("EmergencyContact", EmergencyContact);//紧急联系人标识
        view.addObject("returnvisit", returnvisit);//后续回访标识
        view.addObject("authNm", authNm);//抵押权人名称标识
        view.addObject("procNm", procNm);//流程名称
        view.addObject("isAuditNode", isAuditNode);
        view.addObject("exposureSource", exposureSource);
        view.addObject("isNeedAddTime", isNeedAddTime);
        view.addObject("assetCd", assetCd);

        //抵押权人名称数据字典查询
        List<KeyValueVO> pledgeeNmList = this.sysDictionaryApiService.getKvList(DictionaryConstant.CODE_PLEDGEE_NM, sysCd, orgCd);
        view.addObject("pledgeeNmList", pledgeeNmList);
        AudReturnVisitVO audReturnVisitVO = this.audReturnVisitService.selectByProjectIdAndProIntId(Long.valueOf(prjId));//根据项目id查询信审回访表信息
        if (null != audReturnVisitVO) {
            view.addObject("visitId", audReturnVisitVO.getId());
        }
        //version:2 第二个版本页面处理逻辑    version:3 第三方资管工行卡贷[工行放款确认/驻点人员添加联名卡]跳转capPayInfoModify页面
        String version = request.getParameter("version");
        if (StringUtils.isEmpty(version)) version = "2";
        view.addObject("version", version);

        //2018-2-22 by yaoxiurong 第三方资管工行卡贷
        String accCtrl = request.getParameter("accCtrl");
        String isAddPayerStatusCd = request.getParameter("isAddPayerStatusCd");
        String isAddBank = request.getParameter("isAddBank");
        view.addObject("accCtrl", accCtrl);
        view.addObject("isAddPayerStatusCd", isAddPayerStatusCd);
        view.addObject("isAddBank", isAddBank);

        String saveDueDate = request.getParameter("saveDueDate");//是否可以设置(第一期)还款日
        view.addObject("saveDueDate", saveDueDate);

        String mdfCntTypCd = request.getParameter("mdfCntTypCd");//是否可以修改合同签署方式  1:修改
        view.addObject("mdfCntTypCd", mdfCntTypCd);

        if (StringUtils.isEmpty(prjId))
            throw new BaseException(BaseExceptionConstant.BASE_EXCEPTION_CODE_600, "流程中业务主键为空.");

        //接收流程定义URL 传过来的控制参数
        String hjzxFlag = request.getParameter("hjzxFlag");//呼叫中心:编辑是否团单:hjzxFlag 放款合同意见
        if (StringUtils.isEmpty(hjzxFlag)) {
            hjzxFlag = "0";
        }
        String ctrlKey = request.getParameter("ctrlKey");//控制放款资料页签的操作 "3":不可操作  "2":验证放款资料  "1":上传/删除
        if (StringUtils.isEmpty(ctrlKey)) {
            ctrlKey = "3";
        }
        String xsFlag = request.getParameter("xsFlag");//信审审核 放款抵押意见
        if (StringUtils.isEmpty(xsFlag)) {
            xsFlag = "0";
        }
        String kjshFlag = request.getParameter("kjshFlag");//会计审核:核算实际付款金额(付款方)kjshFlag
        if (StringUtils.isEmpty(kjshFlag)) {
            kjshFlag = "0";
        }
        String zjlFlag = request.getParameter("zjlFlag");//呈报人:可编辑收款方账号:zjlFlag=1(收款方)
        if (StringUtils.isEmpty(zjlFlag)) {
            zjlFlag = "0";
        }
        String btnFlag = request.getParameter("btnFlag");//保存按钮显示 btnFlag=1
        if (StringUtils.isEmpty(btnFlag)) {
            btnFlag = "0";
        }
        String zjbFlag = request.getParameter("zjbFlag");//资金部:可编辑付款方式:zjbFlag=1(收款方)
        if (StringUtils.isEmpty(zjbFlag)) {
            zjbFlag = "0";
        }
        String cnFlag = request.getParameter("cnFlag"); //出纳:可编辑时间,金额:cnFlag=1(非网银)
        if (StringUtils.isEmpty(cnFlag)) {
            cnFlag = "0";
        }
        String spFlag = request.getParameter("spFlag"); //上牌
        if (StringUtils.isEmpty(spFlag)) {
            spFlag = "0";
        }
        String dyFlag = request.getParameter("dyFlag"); //抵押
        if (StringUtils.isEmpty(dyFlag)) {
            dyFlag = "0";
        }

        String isCPCW = request.getParameter("isCPCW"); //城配财务付款
        if (StringUtils.isEmpty(isCPCW)) {
            isCPCW = "0";
        }

        view.addObject("isCPCW", isCPCW);
        view.addObject("btnFlag", btnFlag);
        view.addObject("hjzxFlag", hjzxFlag);
        view.addObject("kjshFlag", kjshFlag);
        view.addObject("zjlFlag", zjlFlag);
        view.addObject("zjbFlag", zjbFlag);
        view.addObject("cnFlag", cnFlag);
        view.addObject("xsFlag", xsFlag);
        view.addObject("spFlag", spFlag);
        view.addObject("dyFlag", dyFlag);
        view.addObject("ctrlKey", ctrlKey);

        String checkSp = request.getParameter("checkSp");//是否有验证上牌信息权限
        view.addObject("checkSp", checkSp);
        String checkDy = request.getParameter("checkDy");//是否有验证抵押信息权限
        view.addObject("checkDy", checkDy);

        //by YAOXIURONG 17-9-1
        String QZTX = request.getParameter("QZTX");//起租提醒节点标识
        view.addObject("QZTX", QZTX);

        //by YAOXIURONG 17-9-7
        String addReturnInfo = request.getParameter("addReturnInfo");//是否可以保存实付时间和金额(网银实际付款成功确没有回传时间和金额)
        view.addObject("addReturnInfo", addReturnInfo);


        String addReturnInfo_rebate = request.getParameter("addReturnInfo_rebate");//是否可以保存【返利账户】实付时间和金额
        view.addObject("addReturnInfo_rebate", addReturnInfo_rebate);
        String modifyRebateBank = request.getParameter("modifyRebateBank");//是否可以修改【返利账户】账户信息
        view.addObject("modifyRebateBank", modifyRebateBank);

        String saveOrgBizOpnCd = request.getParameter("saveOrgBizOpnCd");//是否可以修改【返利账户】账户信息
        view.addObject("saveOrgBizOpnCd", saveOrgBizOpnCd);

        return view;
    }

    private ModelAndView toAdditionalAudit(HttpServletRequest request, String isGpsNode, Long capPayId) {
//            String capPayId = request.getParameter("capPayId");//业务主键(付款信息ID)
        String sysCd = CurrentThreadContext.getCurrentSysCd();
        String orgCd = CurrentThreadContext.getCurrentOrgCd();
        ModelAndView view = new ModelAndView("capital/flowAdditionalInfo/payFlowAdditionalPageV2");
        try {
            String isAuditNode = request.getParameter("isAuditNode");//是否信审节点标识
            String EmergencyContact = request.getParameter("EmergencyContact");//紧急联系人标识
            String returnvisit = request.getParameter("returnvisit");//后续回访标识

            String proIntId = request.getParameter("processInstanceId");//流程实例ID
            String taskId = request.getParameter("taskId");//任务ID
            String taskDefKey = request.getParameter("taskDefKey");//任务KEY
            String taskNm = request.getParameter("taskNm");//任务名称
            String procNm = request.getParameter("procNm");//流程名称
            String authNm = request.getParameter("authNm");//抵押权人修改标识
            String setLeaseData = request.getParameter("setLeaseData");//资方起租日是否显示
            if (taskNm != null && (taskNm.equals("信审审核") ||
                    taskNm.contains("信审审核抵押") ||
                    taskNm.contains("信审审核上牌抵押"))) {
                isAuditNode = "1";
            }

            /**
             * "信审遗留问题"字段修改标识（add by JL 20190819）
             * [信审审核/信审审核上牌抵押/信审审核抵押/商务审批]节点均允许修改
             */
            if (taskNm != null && (taskNm.equals("信审审核") || taskNm.contains("信审审核上牌抵押") || taskNm.contains("信审审核抵押")
                    || taskNm.contains("商务审批") || taskNm.contains("商务审核"))) {
                view.addObject("mdf_AudRemainPro", "1"); //1 允许修改
            }

            /**
             * 以下特定流程的节点，有维护抵押信息权限
             * 重卡正常放款流程-上牌抵押FLOW_00000001_002_001_007
             * 二手车正常放款流程-上牌抵押FLOW_0000_002_001_008
             * 车抵贷线下正常放款流程-上牌抵押FLOW_0000_002_005_008
             */
            if (("重卡正常放款流程".equals(procNm) && "FLOW_00000001_002_001_007".equals(taskDefKey))
                    || ("二手车正常放款流程".equals(procNm) && "FLOW_0000_002_001_008".equals(taskDefKey))
                    || ("车抵贷线下正常放款流程".equals(procNm) && "FLOW_0000_002_005_008".equals(taskDefKey))) {
                view.addObject("canUpdateMtg", 1);
            }

            view.addObject("capPayId", capPayId);
            view.addObject("proIntId", proIntId);
            view.addObject("taskId", taskId);
            view.addObject("taskDefKey", taskDefKey);
            view.addObject("taskNm", taskNm);
            view.addObject("procNm", procNm);
            view.addObject("isAuditNode", isAuditNode);
            view.addObject("EmergencyContact", EmergencyContact);//紧急联系人标识
            view.addObject("returnvisit", returnvisit);//后续回访标识
            view.addObject("authNm", authNm);//抵押权人修改标识
            String mdfCntTypCd = request.getParameter("mdfCntTypCd");//是否可以修改合同签署方式  1:修改
            view.addObject("mdfCntTypCd", mdfCntTypCd);
            view.addObject("setLeaseData", setLeaseData);

            String mdfInsPlc = request.getParameter("mdfInsPlc");//是否可以编辑保单信息 1:可以编辑
            view.addObject("mdfInsPlc", mdfInsPlc);
            view.addObject("isGpsNode", isGpsNode);
            view.addObject("currentUsrId", CurrentThreadContext.getCurrentUserId());

            if (StringUtils.isEmpty(capPayId))
                throw new BaseException(BaseExceptionConstant.BASE_EXCEPTION_CODE_600, "流程中业务主键为空.");
            //查询付款信息
            BaseLogUtils.newWebLogger("===查询付款信息Start===capPayId:" + capPayId).info();
            CapPayInfoVO capPayInfoVO = this.capPayInfoService.selectById(Long.valueOf(capPayId));
            BaseLogUtils.newWebLogger("===查询付款信息End===capPayId:" + capPayId + ",capPayInfoVO:" + JSON.toJSONString(capPayInfoVO)).info();
            view.addObject("prjId", capPayInfoVO.getPrjId());//项目id
            view.addObject("prjPrdDtlId", capPayInfoVO.getPrjPrdDtlId());//项目产品明细id
            List<KeyValueVO> genderCdList = this.cstBscInfoService.searchGenderCdList();//性别
            List<KeyValueVO> rlCdList = this.prjBscInfoService.getRlCdList();//与承租人关系
            view.addObject("genderCdList", JSON.toJSONString(genderCdList));
            view.addObject("rlCdList", JSON.toJSONString(rlCdList));
            AudReturnVisitVO audReturnVisitVO = this.audReturnVisitService.selectByProjectIdAndProIntId(capPayInfoVO.getPrjId());
            if (null != audReturnVisitVO) {
                view.addObject("visitId", audReturnVisitVO.getId());
            }
            PrjPrdMtgVO prdMtgVO = this.prjPrdMtgService.selectById(capPayInfoVO.getPrjPrdDtlId());
            if (null != prdMtgVO) {
                String pledgeeAuthNm = prdMtgVO.getPledgeeAuthNm();//抵押权人名称
                view.addObject("pledgeeAuthNm", pledgeeAuthNm);
            }
            //抵押权人名称数据字典查询
            List<KeyValueVO> pledgeeNmList = this.sysDictionaryApiService.getKvList(DictionaryConstant.CODE_PLEDGEE_NM, sysCd, orgCd);
            view.addObject("pledgeeNmList", pledgeeNmList);
            String saveDueDate = request.getParameter("saveDueDate");//是否可以设置(第一期)还款日
            if ("1".equals(saveDueDate) && StringUtils.isNotEmpty(capPayInfoVO.getPrjPrdId())) {
                //查询是否上装产品
                PrjPrdBscInfoVO prjPrdBscInfoVO = this.prjPrdBscInfoService.selectById(capPayInfoVO.getPrjPrdId());
                if (null != prjPrdBscInfoVO && CarStyleConstant.PRD_TYP_8.equals(prjPrdBscInfoVO.getPrdTypCd())) {
                    saveDueDate = "0";
                }
            }

            //风险标记开始
            List<Long> prjPrdDtlIdList = new ArrayList<Long>();
            prjPrdDtlIdList.add(capPayInfoVO.getPrjPrdDtlId());
            Map<String, String> result = this.rskCstSignLogService.searchRskResInfo(capPayInfoVO.getCstId(), Long.valueOf(capPayInfoVO.getPrjId()), prjPrdDtlIdList);
            if (MapUtils.isNotEmpty(result)) {
                view.addObject("rskCstSignDesc", result.get("rskCstSignDesc"));//客户风险标记
                view.addObject("rskProdSignDesc", result.get("rskProdSignDesc"));//设备风险标记
                view.addObject("rskGuarSignDesc", result.get("rskGuarSignDesc"));//担保人风险标记
            } else {
                view.addObject("rskCstSignDesc", "");//客户风险标记
                view.addObject("rskProdSignDesc", "");//设备风险标记
                view.addObject("rskGuarSignDesc", "");//担保人风险标记
            }

            view.addObject("saveDueDate", saveDueDate);
            //查询第一期还款日
            PrjPrdPaySchMVO prdPaySchMVO = this.prjPrdPaySchMService.selectById(capPayInfoVO.getPaySchId());
            if (null != prdPaySchMVO && null != prdPaySchMVO.getFstRepayDt()) {
                view.addObject("dueDate", DateUtils.formatDateToString(prdPaySchMVO.getFstRepayDt(), DateUtils.YYYY_MM_DD));
            }

            String saveOrgBizOpnCd = request.getParameter("saveOrgBizOpnCd");//是否可以编辑三方业务处理意见 1:可以编辑
            view.addObject("saveOrgBizOpnCd", saveOrgBizOpnCd);
            //三方业务处理意见
            List<KeyValueVO> orgBizOpnCdList = this.capPayInfoService.searchOrgBizOpnCdList();
            view.addObject("orgBizOpnCdList", orgBizOpnCdList);
            PrjBscExtDTO prjBscExtDTO = this.prjBscExtApiService.searchById(capPayInfoVO.getPrjId());
            if (null == prjBscExtDTO) prjBscExtDTO = new PrjBscExtDTO();
            view.addObject("prjBscExtDTO", prjBscExtDTO);

            //是否需求安装有限GPS
            Long projectId = capPayInfoVO.getPrjId();
            PrjBscInfoVO prjBscInfoVO = prjBscInfoService.selectById(projectId);

            String assetCd = request.getParameter("assetCd");// 校验资方放款（人工）
            if (StringUtils.isNotEmpty(assetCd) && "1".equals(assetCd)
                    && null != prjBscInfoVO && PrjBscInfoConstant.PRJ_INS_CODE_JXBANK.equals(prjBscInfoVO.getInsCode())) {
                view.setViewName("capital/flowAdditionalInfo/payFlowAdditionalPageForJxbank");
            }

            BaseLogUtils.newWebLogger("查询是否安装有限GPS项目结果prjBscInfoVO" + JSON.toJSONString(prjBscInfoVO)).info();
            if (null != prjBscInfoVO.getRcCstBscInfoId()) {
                BaseParamDTO baseParamDTO = new BaseParamDTO();
                baseParamDTO.setSysCd(CurrentThreadContext.getCurrentSysCd());
                baseParamDTO.setChannelCd(WebBaseConstant.CHANNEL_CD);
                baseParamDTO.setFrontCd(PropertiesCacheUtils.getProperty(WebBaseConstant.FL_SERVICE_SYS_CD));
                baseParamDTO.setServiceCd(PropertiesCacheUtils.getProperty(WebBaseConstant.FL_SERVICE_SYS_CD));
                BaseLogUtils.newWebLogger("查询是否安装有限GPS入参id=" + prjBscInfoVO.getRcCstBscInfoId() + "baseParamDTO=" + JSON.toJSONString(baseParamDTO)).info();
                DataResultDTO dataResultDTO = externalAcardGpsApiService.getAcardGps(prjBscInfoVO.getRcCstBscInfoId(), baseParamDTO);
                BaseLogUtils.newWebLogger("查询是否安装有限GPS结果dataResultDTO=" + JSON.toJSONString(dataResultDTO)).info();
                if (null != dataResultDTO && null != dataResultDTO.getData()) {
                    //事业部
                    if (PrjBscInfoConstant.CODE_BU_ORG_CD_ZK.equals(capPayInfoVO.getBuOrgCd()) || PrjBscInfoConstant.CODE_BU_ORG_CD_YC.equals(capPayInfoVO.getBuOrgCd())) {
                        //项目类型
                        if (PrjBscInfoConstant.PRJ_TYP_CD_DSFZGCP.equals(capPayInfoVO.getPrjTypCd()) || PrjBscInfoConstant.PRJ_TYP_CD_DSFZGCT.equals(capPayInfoVO.getPrjTypCd())
                                || PrjBscInfoConstant.PRJ_TYP_CD_CTYW.equals(capPayInfoVO.getPrjTypCd()) || PrjBscInfoConstant.PRJ_TYP_CD_CPYW.equals(capPayInfoVO.getPrjTypCd())
                                || PrjBscInfoConstant.PRJ_TYP_CD_ESCJYD.equals(capPayInfoVO.getPrjTypCd()) || PrjBscInfoConstant.PRJ_TYP_CD_OWNJYD.equals(capPayInfoVO.getPrjTypCd())) {
                            view.addObject("gpsFlag", dataResultDTO.getData());
                        }
                    }
                }
            }
            //系统判断方案审核结果
            if (prjBscInfoVO != null && prjBscInfoVO.getAuditInfo() != null) {
                String auditInfo = prjBscInfoVO.getAuditInfo();
                if (StringUtils.isNotEmpty(auditInfo)) {
                    String replaceAll = auditInfo.replaceAll(">>", "</br>");
                    view.addObject("auditInfo", replaceAll);
                }
            }

            //三方资管查询征信结果
            try {
                view.addObject("cntTypCd", prjBscInfoVO.getCntTypCd());
                String insCode = "";//三方机构标识
                if (StringUtils.isNotEmpty(prjBscInfoVO.getInsCode())) {
                    insCode = prjBscInfoVO.getInsCode();
                }
                view.addObject("insCode", insCode);
                view.addObject("prjTypCd", prjBscInfoVO.getPrjTypCd());
                view.addObject("isInsBiz", prjBscInfoVO.getIsInsBiz());

                if (null != prjBscInfoVO && StringUtils.isNotEmpty(prjBscInfoVO.getPrjTypCd()) && null != prjBscInfoVO.getFundRasInsId()) {

                    //REQ-3756 36资管机构路由 by yaoxiurong 作废第三方资管城配,第三方资管传统 新增字段IS_INS_BIZ标识是否资管业务
                    if ((null != prjBscInfoVO.getIsInsBiz() && BaseConstant.IS_YESNO_YES == prjBscInfoVO.getIsInsBiz().intValue())) {
                        if (!PrjBscInfoConstant.PRJ_INS_CODE_SN.equals(prjBscInfoVO.getInsCode())) {
                            //查询征信发送状态
                            InfTransLogQueryCondition itlQC = new InfTransLogQueryCondition();
                            //浙商查询条件特殊处理
                            if (PrjBscInfoConstant.PRJ_INS_CODE_ZS.equals(prjBscInfoVO.getInsCode())) {
                                itlQC.setAction(cmm.mid.core.framework.constant.tripartite.InterfaceConstants.Action.submitCredit.key());//提交征信查询
                                itlQC.setCstId(prjBscInfoVO.getCstId());//客户ID
                                itlQC.setFundRasInsId(prjBscInfoVO.getFundRasInsId());
                                itlQC.setStatus(cmm.mid.core.framework.constant.tripartite.InterfaceConstants.TransStatus.success.key());//成功状态
                            } else {
                                itlQC.setAction(cmm.mid.core.framework.constant.tripartite.InterfaceConstants.Action.submitCredit.key());//提交征信查询
                                itlQC.setPrjId(Long.valueOf(projectId));
                                itlQC.setFundRasInsId(prjBscInfoVO.getFundRasInsId());
                            }
                            BaseLogUtils.newWebLogger("===查询征信发送结果Start===prjId:" + projectId).info();
                            List<InfTransLogDTO> findTransLogs = this.transLogApi.findTransLogs(itlQC);
                            BaseLogUtils.newWebLogger("===查询征信发送结果End===prjId:" + projectId + ",findTransLogs:" + JSON.toJSONString(findTransLogs)).info();
                            String sendStatus = "";//征信发送状态
                            if (CollectionUtils.isNotEmpty(findTransLogs)) {
                                InfTransLogDTO infTransLogDTO = findTransLogs.get(0);
                                if (null != infTransLogDTO) {
                                    sendStatus = infTransLogDTO.getStatus();
                                }
                            }
                            view.addObject("sendStatus", sendStatus);//同步状态 unsent-未发送  success-发送成功  failure-发送失败
                            view.addObject("sendStatusNm", this.getStatusNm(sendStatus));
                            //查询征信结果
                            //因为浙商没有客户信息审核结果,为了保证上线时间,这里先不做查询
                            if ("success".equals(sendStatus) && PrjBscInfoConstant.PRJ_INS_CODE_ZS.equals(prjBscInfoVO.getInsCode())) {
                                view.addObject("auditResult", "pass");//审核结果
                                view.addObject("auditDesc", "");//审核描述
                            }
                            if ("success".equals(sendStatus) && !PrjBscInfoConstant.PRJ_INS_CODE_ZS.equals(prjBscInfoVO.getInsCode())) {
                                PrjPrdPaySchMQueryCondition pppsmQC = new PrjPrdPaySchMQueryCondition();
                                pppsmQC.setPrjId(Long.valueOf(projectId));
                                pppsmQC.setPaySchTypCd(PrjPrdPaySchMConstant.PAY_SCH_TYP_CD_WS);
                                BaseLogUtils.newWebLogger("===查询支付表信息Start===prjId:" + projectId).info();
                                List<PrjPrdPaySchMVO> prjPrdPaySchMVOList = this.prjPrdPaySchMService.searchList(pppsmQC);
                                BaseLogUtils.newWebLogger("===查询支付表信息End===prjId:" + projectId + ",prjPrdPaySchMVOList:" + JSON.toJSONString(prjPrdPaySchMVOList)).info();
                                if (CollectionUtils.isNotEmpty(prjPrdPaySchMVOList)) {
                                    List<Long> exclusivePrjPaySchIds = new ArrayList<Long>();
                                    //过滤掉上装支付表
                                    PrjPrdBscInfoQueryCondition ppbiQC = new PrjPrdBscInfoQueryCondition();
                                    ppbiQC.setPrjId(Long.valueOf(projectId));
                                    BaseLogUtils.newWebLogger("=查询项目产品信息Start=prjId:" + projectId).info();
                                    List<PrjPrdBscInfoVO> prjPrdBscInfoVOList = this.prjPrdBscInfoService.searchList(ppbiQC);
                                    BaseLogUtils.newWebLogger("=查询项目产品信息End=prjId:" + projectId + ",prjPrdBscInfoVOList:" + JSON.toJSONString(prjPrdBscInfoVOList)).info();
                                    List<Long> exclusivePrjPrdIds = new ArrayList<Long>();
                                    if (CollectionUtils.isNotEmpty(prjPrdBscInfoVOList)) {
                                        for (PrjPrdBscInfoVO prjPrdBscInfoVO : prjPrdBscInfoVOList) {
                                            if (CarStyleConstant.PRD_TYP_8.equals(prjPrdBscInfoVO.getPrdTypCd())) {
                                                exclusivePrjPrdIds.add(prjPrdBscInfoVO.getId());
                                            }
                                        }
                                    }
                                    PrjPrdDtlQueryCondition ppdQC = new PrjPrdDtlQueryCondition();
                                    ppdQC.setPrjId(Long.valueOf(projectId));
                                    BaseLogUtils.newWebLogger("=查询项目产品明细Start=prjId:" + projectId).info();
                                    List<PrjPrdDtlVO> prjPrdDtlVOList = this.prjPrdDtlService.selectList(ppdQC);
                                    BaseLogUtils.newWebLogger("=查询项目产品明细End=prjId:" + projectId + ",prjPrdDtlDTOList:" + JSON.toJSONString(prjPrdDtlVOList)).info();
                                    if (CollectionUtils.isNotEmpty(prjPrdDtlVOList)) {
                                        for (PrjPrdDtlVO prjPrdDtlVO : prjPrdDtlVOList) {
                                            if (exclusivePrjPrdIds.contains(prjPrdDtlVO.getPrjPrdId())) {
                                                exclusivePrjPaySchIds.add(prjPrdDtlVO.getPaySchId());
                                            }
                                        }
                                    }
                                    List<Long> paySchIds = new ArrayList<Long>();
                                    for (PrjPrdPaySchMVO prjPrdPaySchMVO : prjPrdPaySchMVOList) {
                                        if (exclusivePrjPaySchIds.contains(prjPrdPaySchMVO.getId())) {
                                            continue;
                                        }
                                        paySchIds.add(prjPrdPaySchMVO.getId());
                                    }
                                    BaseLogUtils.newWebLogger("===查询征信请求结果Start===prjId:" + projectId).info();
                                    cmm.mid.core.framework.dto.MessageDTO<CreditDTO> queryCredit = this.tripartiteApi.queryCredit(prjBscInfoVO.getFundRasInsId(), prjBscInfoVO.getInsCode(), prjBscInfoVO.getId(), paySchIds);
                                    BaseLogUtils.newWebLogger("===查询征信请求结果End===prjId:" + projectId).info();
                                    if (null != queryCredit && queryCredit.isSuccess()) {
                                        CreditDTO creditDTO = queryCredit.getData();
                                        if (null != creditDTO) {
                                            String auditResult = creditDTO.getAuditResult();
                                            String auditDesc = creditDTO.getAuditDesc();
                                            view.addObject("auditResult", auditResult);//审核结果
                                            view.addObject("auditDesc", auditDesc);//审核描述
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            } catch (Exception e) {
                BaseLogUtils.newWebLogger("===查询征信异常===prjId:" + projectId).info();
                e.printStackTrace();
            }

            BaseLogUtils.newWebLogger("===查询租赁物数量、历史付款次数、上传资料数量Start===capPayId:" + capPayId + ",capPayInfoVO:" + JSON.toJSONString(capPayInfoVO)).info();
            //Tab头 查询付款信息中租赁物数量、历史付款次数、上传资料数量
            capPayInfoVO = this.capPayInfoService.getPayInfoCount(capPayInfoVO);
            BaseLogUtils.newWebLogger("===查询租赁物数量、历史付款次数、上传资料数量End===capPayId:" + capPayId + ",capPayInfoVO:" + JSON.toJSONString(capPayInfoVO)).info();
            view.addObject("capPayInfoVO", capPayInfoVO);
            //查询代扣卡验证状态
            String audStsCdNm = "";
            CstBankQueryCondition cstBankQC = new CstBankQueryCondition();
            List<Long> cstIdList = new ArrayList<Long>();
            cstIdList.add(capPayInfoVO.getCstId());
            cstBankQC.setCstIdList(cstIdList);
            cstBankQC.setIsDeduct(BaseConstant.IS_YESNO_YES);
            cstBankQC.setSysCd(CurrentThreadContext.getCurrentSysCd());
            cstBankQC.setOrgCd(CurrentThreadContext.getCurrentOrgCd());

            BaseLogUtils.newWebLogger("===根据查询条件获取客户帐号信息Start===cstId:" + capPayInfoVO.getCstId() + ",cstBankQC:" + JSON.toJSONString(cstBankQC)).info();
            List<CstBankDTO> list = this.customerQueryApiService.searchCstBankWithCstInfoList(cstBankQC);
            BaseLogUtils.newWebLogger("===根据查询条件获取客户帐号信息End===cstId:" + capPayInfoVO.getCstId() + ",list:" + JSON.toJSONString(list)).info();
            if (CollectionUtils.isNotEmpty(list)) {
                CstBankDTO cstBankDTO = list.get(0);
                if (null != cstBankDTO) {
                    audStsCdNm = cstBankDTO.getAudStsCdNm();
                }
            }
            view.addObject("audStsCdNm", audStsCdNm);


            //收款方类型
            List<KeyValueVO> payeeTypCdList = this.capPayInfoService.getPayeeTypCdList();
            view.addObject("payeeTypCdList", JSON.toJSONString(payeeTypCdList));
            //款项
				/*List<KeyValueVO> fundTypCdList=this.capPayInfoService.getFundTypCdList();
			view.addObject("fundTypCdList",JSON.toJSONString(fundTypCdList));*/
            //付款方式
            List<KeyValueVO> payWayCdList = this.capPayInfoService.getPayWayCdList();
            view.addObject("payWayCdList", JSON.toJSONString(payWayCdList));
            //账户类型
            List<KeyValueVO> bkAccTypCdList = this.capPayInfoService.getBkAccTypCdList();
            view.addObject("bkAccTypCdList", JSON.toJSONString(bkAccTypCdList));
            //是否
            List<KeyValueVO> yesOrNOList = this.capPayInfoService.searchYesOrNOList();
            view.addObject("yesOrNOList", yesOrNOList);
            //是否团单
            List<KeyValueVO> isGrpList = this.capPayInfoService.searchIsGrpList();
            view.addObject("isGrpList", isGrpList);
            //合同签署方式
            List<KeyValueVO> cntTypCdList = this.prjBscInfoService.getCntTypCdList();
            view.addObject("cntTypCdList", cntTypCdList);

            //查询收款方信息
            CapPayeeInfoQueryCondition payeeInfoQueryCondition = new CapPayeeInfoQueryCondition();
            payeeInfoQueryCondition.setPayId(Long.valueOf(capPayId));
            payeeInfoQueryCondition.setSortOrder(" PURP_CD ");
            BaseLogUtils.newWebLogger("===查询放款详细信息Start===capPayId:" + capPayId + ",qc:" + JSON.toJSONString(payeeInfoQueryCondition)).info();
            List<CapPayeeInfoVO> payeeVOList = capPayeeInfoService.searchList(payeeInfoQueryCondition);
            BaseLogUtils.newWebLogger("===查询放款详细信息End===capPayId:" + capPayId + ",payeeVOList:" + JSON.toJSONString(payeeVOList)).info();

            //查询发送网银状态
            String isAllowSendPay = "0";//是否显示发送网银按钮
            List<String> purpList = new ArrayList<>(payeeVOList.size());
            Long amountPayable = 0L;
            Long amountPayables = 0L;
            Long installment = 0L;
            Long firstAmt = 0L;
            Long totalAmt = 0L;
            for (CapPayeeInfoVO capPayeeInfoVO : payeeVOList) {
                purpList.add(capPayeeInfoVO.getPurpCd());
                if (null != capPayeeInfoVO.getActPayTm()) {
                    capPayeeInfoVO.setActPayTms(DateUtils.formatDateToString(capPayeeInfoVO.getActPayTm(), DateUtils.YYYY_MM_DD));
                }

                //先查询
                BaseLogUtils.newWebLogger("===根据放款单流水号查询支付单信息Start===capPayeeId:" + capPayeeInfoVO.getId()).info();
                InfBfsPayDTO bfsPayDTO = this.bFSApiService.selectByFlsNum(Long.valueOf(capPayeeInfoVO.getId()));
                BaseLogUtils.newWebLogger("===根据放款单流水号查询支付单信息End===capPayeeId:" + capPayeeInfoVO.getId() + ",bfsPayDTO:" + JSON.toJSONString(bfsPayDTO)).info();
                //不存在	或者	发送失败	或者	付款失败		需要显示发送网银接口
                if (null == bfsPayDTO
                        || InterfaceConstants.BfsPayStatus.payFailure.key().equals(bfsPayDTO.getStatus())
                        || InterfaceConstants.BfsPayStatus.sendFailure.key().equals(bfsPayDTO.getStatus())) {
                    isAllowSendPay = "1";
                    capPayeeInfoVO.setIsSended(BaseConstant.IS_YESNO_NO);
                } else {
                    capPayeeInfoVO.setIsSended(BaseConstant.IS_YESNO_YES);
                }
                //处理金额
                if (capPayeeInfoVO.getPurpCd().equals(CapitalConstant.CODE_SPL_BK_PURP_CD_1)) {
                    Long[] payAmt = this.prjPrdDtlService.downPaymentAmount(capPayInfoVO.getPrjPrdDtlId(), capPayInfoVO.getPaySchId());
                    for (int i = 0; i < payAmt.length; i++) {
                        firstAmt = payAmt[0];//首期
                        totalAmt = payAmt[1];//总和
                    }
                    if (firstAmt != 0L && totalAmt != 0L) {
                        InsApplicationVO insApplicationVO = this.insApplicationStagingService.getInstallmentInformation(capPayInfoVO.getPrjPrdDtlId(), capPayInfoVO.getPaySchId());
                        installment = 1L;
                        view.addObject("insApplicationVO", insApplicationVO);
                        amountPayable = capPayeeInfoVO.getRealPayAmt();
                        view.addObject("amountPayableq", DecimalUtils.convertFenToYuan(amountPayable));
                    }
                }
                capPayeeInfoVO.setPayAmts(String.valueOf(DecimalUtils.convertFenToYuan(capPayeeInfoVO.getPayAmt())));
                capPayeeInfoVO.setActPayAmts(capPayeeInfoVO.getActPayAmt() == null ? null : String.valueOf(DecimalUtils.convertFenToYuan(capPayeeInfoVO.getActPayAmt())));
            }
            view.addObject("firstAmt", DecimalUtils.convertFenToYuan(firstAmt));
            view.addObject("totalAmt", DecimalUtils.convertFenToYuan(totalAmt));
            view.addObject("installment", installment);
            view.addObject("amountPayable", DecimalUtils.convertFenToYuan(amountPayable));
            view.addObject("accSize", purpList);
            view.addObject("isAllowSendPay", isAllowSendPay);
            view.addObject("isAllowMdfPayTypCd", isAllowSendPay);
            view.addObject("payeeList", payeeVOList);

            //接收流程定义URL 传过来的控制参数
            String hjzxFlag = request.getParameter("hjzxFlag");//呼叫中心:编辑是否团单:hjzxFlag 放款合同意见
            if (StringUtils.isEmpty(hjzxFlag)) {
                hjzxFlag = "0";
            }
            String ctrlKey = request.getParameter("ctrlKey");//控制放款资料页签的操作 "3":不可操作  "2":验证放款资料  "1":上传/删除
            if (StringUtils.isEmpty(ctrlKey)) {
                ctrlKey = "3";
            }
            String xsFlag = request.getParameter("xsFlag");//信审审核 放款抵押意见
            if (StringUtils.isEmpty(xsFlag)) {
                xsFlag = "0";
            }
            String kjshFlag = request.getParameter("kjshFlag");//会计审核:核算实际付款金额(付款方)kjshFlag
            if (StringUtils.isEmpty(kjshFlag)) {
                kjshFlag = "0";
            }
            String zjlFlag = request.getParameter("zjlFlag");//呈报人:可编辑收款方账号:zjlFlag=1(收款方)
            if (StringUtils.isEmpty(zjlFlag)) {
                zjlFlag = "0";
            }
            String btnFlag = request.getParameter("btnFlag");//保存按钮显示 btnFlag=1
            if (StringUtils.isEmpty(btnFlag)) {
                btnFlag = "0";
            }
            String zjbFlag = request.getParameter("zjbFlag");//资金部:可编辑付款方式:zjbFlag=1(收款方)
            if (StringUtils.isEmpty(zjbFlag)) {
                zjbFlag = "0";
            }
            String cnFlag = request.getParameter("cnFlag"); //出纳:可编辑时间,金额:cnFlag=1(非网银)
            if (StringUtils.isEmpty(cnFlag)) {
                cnFlag = "0";
            }
            String spFlag = request.getParameter("spFlag"); //上牌
            if (StringUtils.isEmpty(spFlag)) {
                spFlag = "0";
            }
            String isExistSp = "";
            String spState = "0";
            Long prjPrdDtlId = capPayInfoVO.getPrjPrdDtlId();
            if (StringUtils.isNotEmpty(prjPrdDtlId)) {
                //查询上牌信息
                BaseLogUtils.newWebLogger("===查询上牌信息Start===prjPrdDtlId:" + prjPrdDtlId).info();
                PrjPrdLicInfoVO prjPrdLicInfoVO = this.prjPrdLicInfoService.selectById(prjPrdDtlId);
                BaseLogUtils.newWebLogger("===查询上牌信息End===prjPrdDtlId:" + prjPrdDtlId + ",prjPrdLicInfoVO:" + JSON.toJSONString(prjPrdLicInfoVO)).info();
                if (null == prjPrdLicInfoVO) {
                    isExistSp = "0";
                } else {
                    isExistSp = "1";
                }
                if (null != prjPrdLicInfoVO && FlowConstant.FLOW_CHECK_STATE_PASS.equals(prjPrdLicInfoVO.getAudStsCd())) {
                    spState = "1";
                }
            }
            view.addObject("spState", spState);
            view.addObject("isExistSp", isExistSp);
            String dyFlag = request.getParameter("dyFlag"); //抵押
            if (StringUtils.isNotEmpty(dyFlag)) {
                dyFlag = dyFlag.replace("\'", "");
            } else {
                dyFlag = "0";
            }
            //2017-3-31 String escFlag = "0";
            String escFlag = "1";
            String isExistDy = "";
            String dyState = "0";
            if (StringUtils.isNotEmpty(prjPrdDtlId)) {
                //查询抵押信息
                BaseLogUtils.newWebLogger("===查询抵押信息Start===prjPrdDtlId:" + prjPrdDtlId).info();
                PrjPrdMtgVO prjPrdMtgVO = this.prjPrdMtgService.selectById(prjPrdDtlId);
                BaseLogUtils.newWebLogger("===查询抵押信息End===prjPrdDtlId:" + prjPrdDtlId + ",prjPrdMtgVO:" + JSON.toJSONString(prjPrdMtgVO)).info();
                if (null == prjPrdMtgVO) {
                    isExistDy = "0";
                } else {
                    isExistDy = "1";
                }
                if (null != prjPrdMtgVO && PrjPrdMtgConstant.CODE_GUAR_STS_CD_MTG.equals(prjPrdMtgVO.getGuarStsCd())) {
                    dyState = "1";
                } else if (null != prjPrdMtgVO && PrjPrdMtgConstant.CODE_GUAR_STS_CD_FOR_MTG.equals(prjPrdMtgVO.getGuarStsCd())) {
                    dyState = "2";
                }
            }
            view.addObject("dyState", dyState);
            view.addObject("escFlag", escFlag);
            view.addObject("dyFlag", dyFlag);
            view.addObject("isExistDy", isExistDy);

            view.addObject("btnFlag", btnFlag);
            view.addObject("hjzxFlag", hjzxFlag);
            view.addObject("kjshFlag", kjshFlag);
            view.addObject("zjlFlag", zjlFlag);
            view.addObject("zjbFlag", zjbFlag);
            view.addObject("cnFlag", cnFlag);
            view.addObject("xsFlag", xsFlag);
            view.addObject("spFlag", spFlag);
            view.addObject("ctrlKey", ctrlKey);

            String isCPCW = request.getParameter("isCPCW");
            view.addObject("isCPCW", isCPCW);
            String isNeedCallback = request.getParameter("isNeedCallback");
            view.addObject("isNeedCallback", isNeedCallback);
            String bhFlag = request.getParameter("bhFlag");//是否可以维护驳回意见
            view.addObject("bhFlag", bhFlag);

            String checkSp = request.getParameter("checkSp");//是否有验证上牌信息权限
            view.addObject("checkSp", checkSp);
            String checkDy = request.getParameter("checkDy");//是否有验证抵押信息权限
            view.addObject("checkDy", checkDy);

            //by YAOXIURONG 17-9-1
            String QZTX = request.getParameter("QZTX");//起租提醒节点标识
            view.addObject("QZTX", QZTX);

            //by YAOXIURONG 17-9-7
            String addReturnInfo = request.getParameter("addReturnInfo");//是否可以保存实付时间和金额(网银实际付款成功确没有回传时间和金额)
            view.addObject("addReturnInfo", addReturnInfo);

            String confirmPay = request.getParameter("confirmPay");//付款审核
            view.addObject("confirmPay", confirmPay);

            String addReturnInfo_rebate = request.getParameter("addReturnInfo_rebate");//是否可以保存【返利账户】实付时间和金额
            view.addObject("addReturnInfo_rebate", addReturnInfo_rebate);
            String modifyRebateBank = request.getParameter("modifyRebateBank");//是否可以修改【返利账户】账户信息
            view.addObject("modifyRebateBank", modifyRebateBank);

            String mdfIsOtherNoPass = request.getParameter("mdfIsOtherNoPass");//是否显示并支持保存修改[除"商家必要资料"外是否有不合规信息]
            view.addObject("mdfIsOtherNoPass", mdfIsOtherNoPass);

            CstBscInfoVO cstBscInfoVO = this.cstBscInfoService.selectDetailById(capPayInfoVO.getCstId());
            if (DictionaryConstant.CODE_CERT_TYP_CD_0.equals(cstBscInfoVO.getCertTypCd())) {
                view.addObject("certNo", cstBscInfoVO.getCertNo()); // 证件号码
            }
            String splRiskWarnCd = null;//供应商高风险预警标识
            String lnkRiskWarnCd = null;//挂靠公司高风险预警标识
            if (StringUtils.isNotEmpty(capPayInfoVO.getPrjPrdId()) || StringUtils.isNotEmpty(capPayInfoVO.getPrjPrdDtlId())) {
                PrjPrdBscInfoVO prjPrdBscInfoVO = this.prjPrdBscInfoService.selectById(capPayInfoVO.getPrjPrdId());
                PrjPrdDtlVO prjPrdDtlVO = this.prjPrdDtlService.selectById(capPayInfoVO.getPrjPrdDtlId());
                if (prjPrdBscInfoVO != null || prjPrdDtlVO != null) {
                    if (prjPrdBscInfoVO.getSplId() != null || prjPrdDtlVO.getLnkCompId() != null) {
                        //供应商高风险预警
                        SplHRiskWarnRecQC splHRiskWarnRecQC = new SplHRiskWarnRecQC();
                        if (prjPrdBscInfoVO.getSplId() != null) {
                            splHRiskWarnRecQC.setDataId(prjPrdBscInfoVO.getSplId());
                            splHRiskWarnRecQC.setDataTyp("SPL"); //SPL:供应商  LNK:挂靠公司
                            splHRiskWarnRecQC.setIsWarn(1);
                            splHRiskWarnRecQC.setIsDel(0);
                            splHRiskWarnRecQC.setIsValid(1);
                            splHRiskWarnRecQC.setIsNew(1);
                        }
                        List<SplHRiskWarnRecDTO> splHRiskWarnRecDTOList = splHRiskWarnRecApiService.checkSplHRiskWarnRecDTOByQC(splHRiskWarnRecQC, CurrentThreadContext.getCurrentSysCd(), CurrentThreadContext.getCurrentOrgCd(), WebBaseConstant.CHANNEL_CD);
                        BaseLogUtils.newWebLogger("查询供应商高风险预警接口返回：" + JSONObject.toJSONString(splHRiskWarnRecDTOList)).info();
                        //挂靠公司高风险预警
                        SplHRiskWarnRecQC lnkHRiskWarnRecQC = new SplHRiskWarnRecQC();
                        if (prjPrdDtlVO.getLnkCompId() != null) {
                            lnkHRiskWarnRecQC.setDataId(prjPrdDtlVO.getLnkCompId());
                            lnkHRiskWarnRecQC.setDataTyp("LNK"); //SPL:供应商  LNK:挂靠公司
                            lnkHRiskWarnRecQC.setIsWarn(1);
                            lnkHRiskWarnRecQC.setIsDel(0);
                            lnkHRiskWarnRecQC.setIsValid(1);
                            lnkHRiskWarnRecQC.setIsNew(1);
                        }
                        List<SplHRiskWarnRecDTO> lnkHRiskWarnRecDTOList = splHRiskWarnRecApiService.checkSplHRiskWarnRecDTOByQC(lnkHRiskWarnRecQC, CurrentThreadContext.getCurrentSysCd(), CurrentThreadContext.getCurrentOrgCd(), WebBaseConstant.CHANNEL_CD);
                        BaseLogUtils.newWebLogger("查询挂靠公司高风险预警接口返回：" + JSONObject.toJSONString(lnkHRiskWarnRecDTOList)).info();
                        //查询供应商、挂靠公司高风险预警标识结果
                        if (CollectionUtils.isNotEmpty(splHRiskWarnRecDTOList) || CollectionUtils.isNotEmpty(lnkHRiskWarnRecDTOList)) {
                            splRiskWarnCd = "1";
                            lnkRiskWarnCd = "1";
                        }
                    }
                }
            }
            view.addObject("splRiskWarnCd", splRiskWarnCd);
            view.addObject("lnkRiskWarnCd", lnkRiskWarnCd);
            // 车抵贷业务（线下）、二手车交易贷 信审审核节点、信审审核抵押节点、信审审核上牌抵押节点 隐藏挂靠公司更改/移除按钮
            BaseLogUtils.newWebLogger("===项目类型===prjTypCd:" + capPayInfoVO.getPrjTypCd() + ";capPayInfoVO:" + JSON.toJSONString(capPayInfoVO)).info();
            if (PrjBscInfoConstant.PRJ_TYP_CD_CDDYWUL.equals(capPayInfoVO.getPrjTypCd()) || PrjBscInfoConstant.PRJ_TYP_CD_ESCJYD.equals(capPayInfoVO.getPrjTypCd())
                    || PrjBscInfoConstant.PRJ_TYP_CD_OWNJYD.equals(capPayInfoVO.getPrjTypCd())) {
                BaseLogUtils.newWebLogger("===项目类型===equal1:" + PrjBscInfoConstant.PRJ_TYP_CD_CDDYWUL.equals(capPayInfoVO.getPrjTypCd()) + ";equal2:" + PrjBscInfoConstant.PRJ_TYP_CD_ESCJYD.equals(capPayInfoVO.getPrjTypCd())).info();
                view.addObject("noLinkAction", true);
            }
        } catch (BaseException e) {
            BaseLogUtils.newWebLogger("===<toAdditionalInfoPage>跳转放款流程附加信息页面BASE异常===Detail:" + e.getMessage()).info();
            e.printStackTrace();
        } catch (Exception e) {
            BaseLogUtils.newWebLogger("===<toAdditionalInfoPage>跳转放款流程附加信息页面异常===Detail:" + e.getMessage()).setThrowable(e).error(LogExceptionEnum.COMMON_CODE_0002);
            e.printStackTrace();
        }
        return view;

    }

    private ModelAndView auditToPrjPage(HttpServletRequest request, String projectId) {
//            String projectId = request.getParameter("projectId");//项目ID
        String proIntId = request.getParameter("processInstanceId");//流程实例ID
        String taskId = request.getParameter("taskId");//任务ID
        String taskDefKey = request.getParameter("taskDefKey");//任务KEY
        String isDetail = request.getParameter("isDetail");//1:其他节点 0:信审节点
        String taskNm = request.getParameter("taskNm");//任务名称
        String ctrlKey = request.getParameter("ctrlKey");//资料标识//控制键 1.可上传、下载、删除 2.可验证 3.不可操作
        String exposureSource = request.getParameter("exposureSource");//是否展示敞口
        // 是否项目外派流程 1: 是
        String isExpFlow = request.getParameter("isExpFlow");
        String homeButton = request.getParameter("homeButton");

        if (StringUtils.isNotEmpty(proIntId)) proIntId = proIntId.replace("\'", "");
        if (StringUtils.isNotEmpty(taskId)) taskId = taskId.replace("\'", "");
        if (StringUtils.isNotEmpty(taskDefKey)) taskDefKey = taskDefKey.replace("\'", "");
        if (StringUtils.isNotEmpty(taskNm)) taskNm = taskNm.replace("\'", "");
        ModelAndView view = new ModelAndView("project/additionalInfo/audNodeAdditionalInfo");
        try {
            String isMdfQuatPrps = "0";//方案是否修改
            if (this.cacheService.keyExists(projectId)) {
                isMdfQuatPrps = "1";
            }
            view.addObject("isMdfQuatPrps", isMdfQuatPrps);

            view.addObject("projectId", projectId);
            view.addObject("proIntId", proIntId);
            view.addObject("taskId", taskId);
            view.addObject("taskDefKey", taskDefKey);
            view.addObject("taskNm", taskNm);
            view.addObject("isDetail", isDetail);
            view.addObject("ctrlKey", ctrlKey);
            view.addObject("exposureSource", exposureSource);
            view.addObject("currentUsrId", CurrentThreadContext.getCurrentUserId());
            view.addObject("isExpFlow", isExpFlow);
            view.addObject("homeButton", homeButton);
            if (StringUtils.isNotEmpty(isExpFlow) && "1".equals(isExpFlow) && StringUtils.isNotEmpty(projectId)) {
                ExpBizManRecQC expBizManRecQC = new ExpBizManRecQC();
                expBizManRecQC.setDataId(Long.valueOf(projectId));
                expBizManRecQC.setIsDel(BaseConstant.IS_YESNO_NO);
                BaseLogUtils.newWebLogger("===查询项目外派人员记录表Start===prjId:" + projectId).info();
                List<ExpBizManRecVO> expBizManRecVOList = this.expBizManRecService.searchList(expBizManRecQC);
                BaseLogUtils.newWebLogger("===查询项目外派人员记录表End===prjId:" + projectId + ",expBizManRecVOList:" + JSON.toJSONString(expBizManRecVOList)).info();
                for (ExpBizManRecVO expBizManRecVO : expBizManRecVOList) {
                    String aptTypCd = expBizManRecVO.getAptTypCd();
                    Long usrId = expBizManRecVO.getUsrId();
                    String rlNm = expBizManRecVO.getRlNm();
                    String usrNm = expBizManRecVO.getUsrNm();
                    if (StringUtils.isNotEmpty(aptTypCd)) {
                        if ("FLOW_0000_071_001_001".equals(taskDefKey) && "1".equals(aptTypCd)) {
                            view.addObject("areaMgrId", usrId);
                            view.addObject("areaMgrUsrNm", usrNm);
                            view.addObject("areaMgrNm", rlNm);
                        }
                        if ("FLOW_0000_071_001_002".equals(taskDefKey) && "2".equals(aptTypCd)) {
                            view.addObject("homeMgrId", usrId);
                            view.addObject("homeMgrUsrNm", usrNm);
                            view.addObject("homeMgrNm", rlNm);
                        }
                        if ("FLOW_0000_071_001_002".equals(taskDefKey) && "3".equals(aptTypCd)) {
                            view.addObject("mortgageMgrId", usrId);
                            view.addObject("mortgageMgrUsrNm", usrNm);
                            view.addObject("mortgageMgrNm", rlNm);
                        }
                    }
                }
                if ("FLOW_0000_071_001_002".equals(taskDefKey)) {
                    PrjPrdDtlQueryCondition prjPrdDtlQC = new PrjPrdDtlQueryCondition();
                    prjPrdDtlQC.setPrjId(Long.valueOf(projectId));
                    prjPrdDtlQC.setSysCd(CurrentThreadContext.getCurrentSysCd());
                    prjPrdDtlQC.setOrgCd(CurrentThreadContext.getCurrentOrgCd());
                    prjPrdDtlQC.setIsDel(BaseConstant.IS_YESNO_NO);
                    BaseLogUtils.newWebLogger("===查询项目产品信息Start===prjPrdDtlQC:" + JSON.toJSONString(prjPrdDtlQC)).info();
                    List<PrjPrdDtlDTO> prjPrdDtlDTOS = this.projectApiService.selectPrjPrdDtlList(prjPrdDtlQC);
                    BaseLogUtils.newWebLogger("===查询项目产品信息Start===prjPrdDtlDTOS-size:" + (CollectionUtils.isEmpty(prjPrdDtlDTOS) ? 0 : prjPrdDtlDTOS.size())).info();
                    // 车辆明细id
                    List<Long> dtlIdList = new ArrayList<>();
                    for (PrjPrdDtlDTO prjPrdDtlDTO : prjPrdDtlDTOS) {
                        if (CollectionUtils.isEmpty(dtlIdList) || !dtlIdList.contains(prjPrdDtlDTO.getId()))
                            dtlIdList.add(prjPrdDtlDTO.getId());
                    }
                    BaseLogUtils.newServiceLogger("===项目产品信息dtlIdList===dtlIdList:" + JSON.toJSONString(dtlIdList)).info();
                    if (CollectionUtils.isNotEmpty(dtlIdList)) {
                        ExpBizManRecQC expBizManRecQCDtl = new ExpBizManRecQC();
                        expBizManRecQCDtl.setDataIdList(dtlIdList);
                        expBizManRecQCDtl.setDataTypCd("DTL");
                        expBizManRecQCDtl.setIsDel(BaseConstant.IS_YESNO_NO);
                        BaseLogUtils.newServiceLogger("==查询项目外派抵押人信息Start==prjId:" + projectId + ",expBizManRecQCDtl:" + JSON.toJSONString(expBizManRecQCDtl)).info();
                        List<ExpBizManRecVO> expBizManRecDTOListDtl = this.expBizManRecService.searchList(expBizManRecQCDtl);
                        BaseLogUtils.newServiceLogger("==查询项目外派抵押人信息End==prjId:" + projectId + ",expBizManRecDTOListDtl:" + JSON.toJSONString(expBizManRecDTOListDtl)).info();
                        for (ExpBizManRecVO expBizManRecVO : expBizManRecDTOListDtl) {
                            Long usrId = expBizManRecVO.getUsrId();
                            String rlNm = expBizManRecVO.getRlNm();
                            String usrNm = expBizManRecVO.getUsrNm();
                            if (StringUtils.isNotEmpty(usrId) && StringUtils.isNotEmpty(rlNm)) {
                                view.addObject("mortgageMgrId", usrId);
                                view.addObject("mortgageMgrUsrNm", usrNm);
                                view.addObject("mortgageMgrNm", rlNm);
                                break;
                            }
                        }
                    }
                }
            }

            // 信审员初审，新能源汽车快捷报单流程 三方资管城配业务工行评审流程 重卡城配项目评审流程 信审员审核
            if ((StringUtils.isNotEmpty(taskNm) && (taskNm.indexOf("信审") != -1 && taskNm.indexOf("初审") != -1))
                    || "FLOW_00000001_001_001_001".equals(taskDefKey) || "FLOW_00000013_001_002_001".equals(taskDefKey) || "FLOW_00000001_001_004_001".equals(taskDefKey)) {
                view.addObject("fromCAFlag", true);
            }

            String confirmPay = request.getParameter("confirmPay");//付款审核 1:可以审核付款可以取消放款 2:只可以审核不可以取消3:车抵贷业务 可以审核不可以取消 显示放款通过意见和驳回意见
            view.addObject("confirmPay", confirmPay);
            String version = request.getParameter("version");
            view.addObject("version", version);

            //征信附议
            String showCredit = request.getParameter("showCredit");//是否显示
            view.addObject("showCredit", showCredit);
            String flag = request.getParameter("flag");//征信标识
            view.addObject("flag", flag);

            //核价员核价标识
            String isNeedPrice = request.getParameter("isNeedPrice");
            view.addObject("isNeedPrice", isNeedPrice);

            //修改GPS标识
            String isGpsNode = request.getParameter("isGpsNode");
            view.addObject("isGpsNode", isGpsNode);

            //生成人保资料标识
            String rbflag = request.getParameter("rbflag");
            view.addObject("rbflag", rbflag);

            //查询项目信息
            PrjBscInfoVO prjBscInfoVO = null;
            String mp = "";//客户经理手机号
            Long registrationCd = 0L;
            if (StringUtils.isNotEmpty(projectId)) {
                prjBscInfoVO = this.prjBscInfoService.selectById(Long.valueOf(projectId));
                if (null != prjBscInfoVO && StringUtils.isNotEmpty(prjBscInfoVO.getCstMgrId())) {
                    SysUsrVO sysUsrVO = this.sysUsrService.selectById(prjBscInfoVO.getCstMgrId(), CurrentThreadContext.getCurrentSysCd());
                    if (null != sysUsrVO && StringUtils.isNotBlank(sysUsrVO.getMp())) {
                        mp = sysUsrVO.getMp();
                    }
                }
                // 验车、里程相关
                try {
                    if (prjBscInfoVO.getPrjTypCd().equals(PrjBscInfoConstant.PRJ_TYP_CD_CDDYWUL)) {
                        registrationCd = this.prjBscInfoService.areOrNoRegistration(Long.valueOf(projectId));//查询验车信息是否录入
                        if (registrationCd == BaseConstant.IS_YESNO_YES) {
                            String validationCar = this.prjBscInfoService.checkMileage(Long.valueOf(projectId));//里程数据判断
                            view.addObject("validationCar", validationCar);
                        }
                        view.addObject("registrationCd", registrationCd);
                    }
                } catch (Exception e) {
                    BaseLogUtils.newWebLogger("车抵贷线下验车异常" + projectId+",e:"+e.getMessage()).setThrowable(e).error(LogExceptionEnum.COMMON_CODE_0002);
                }
            }
            view.addObject("mp", mp);
            view.addObject("prjTypCd", prjBscInfoVO.getPrjTypCd());
            view.addObject("bizTypCd", prjBscInfoVO.getBizTypCd());
            view.addObject("isInsBiz", prjBscInfoVO.getIsInsBiz());
            view.addObject("buOrgCd", prjBscInfoVO.getBuOrgCd());
            view.addObject("isSqlMfr", prjBscInfoVO.getIsSplMfr());
            view.addObject("insCode", prjBscInfoVO.getInsCode());
            // 查找资管机构模块配置
            if (StringUtils.isNotBlank(prjBscInfoVO.getInsCode())) {
                SysInsTabCfgVO sysInsTabCfgVO = this.sysInsTabCfgService.selectByInsCode(prjBscInfoVO.getInsCode());
                if (sysInsTabCfgVO != null) {
                    view.addObject("sysInsTabCfgVO", sysInsTabCfgVO);
                }
            }
            //是否自融
            if (prjBscInfoVO.getIsSelfMelt() != null) {
                view.addObject("isSelfMelt", prjBscInfoVO.getIsSelfMelt());
            }
            //线路类型
            List<KeyValueVO> CircuitTypeCd = this.audReturnVisitService.searchCircuitTypeList();
            view.addObject("CircuitTypeCd", CircuitTypeCd);
            //装卸方式
            List<KeyValueVO> HanglingModeCd = this.audReturnVisitService.searchHanglingModeList();
            view.addObject("HanglingModeCd", HanglingModeCd);
            AudReturnVisitVO voAud = this.audReturnVisitService.selectByProjectIdAndProIntId(Long.valueOf(projectId));
            view.addObject("voAud", voAud);
            if (null != voAud.getId()) {
                GetAudOpeLineByVisitIdRequest getRequest = new GetAudOpeLineByVisitIdRequest();
                getRequest.setVisitId(voAud.getId());
                getRequest.setSysCd(CurrentThreadContext.getCurrentSysCd());
                ResponseData<List<AuditOpeLineDTO>> responseData = auditOpeLineService.getAudvisitOperateLineByVisitId(getRequest);
                List<AudOpeLineVO> audOpeLineList = new ArrayList<>();
                if (responseData != null && ResponseData.SUCCESS_CODE.equals(responseData.getCode()) && responseData.getData() != null) {
                    List<AuditOpeLineDTO> auditOpeLineDTOS = responseData.getData();
                    for (AuditOpeLineDTO auditOpeLineDTO : auditOpeLineDTOS) {
                        AudOpeLineVO audOpeLineVO = new AudOpeLineVO();
                        BeanUtils.copyProperties(auditOpeLineDTO, audOpeLineVO);
                        audOpeLineList.add(audOpeLineVO);
                    }
                }
                if (null != audOpeLineList && audOpeLineList.size() != 0) {
                    view.addObject("audOpeLineList", audOpeLineList);
                    view.addObject("size", audOpeLineList.size());
                } else {
                    view.addObject("size", null);
                }
            } else {
                view.addObject("size", null);
            }
            AuditCreditInfoQueryCondition AudCreditInfoqc = new AuditCreditInfoQueryCondition();
            AudCreditInfoqc.setProIntId(proIntId);
            AudCreditInfoqc.setProjectId(Long.valueOf(projectId));
            AudCreditInfoVO vo = this.audCreditInfoService.selectAudCreditInfoByQc(AudCreditInfoqc);
            if (null == vo) {
                BaseLogUtils.newWebLogger("获取数据,数据不存在.projectId:" + projectId + ",proIntId:" + proIntId).info();
            } else {
                String circuitType = vo.getCircuitType();
                view.addObject("CreditInfocircuitType", circuitType);
                String cargoWeigth = vo.getCargoWeigth();
                view.addObject("CreditInfocargoWeigth", cargoWeigth);
                String cargoVomule = vo.getCargoVomule();
                view.addObject("CreditInfocargoVomule", cargoVomule);
                String handingMode = vo.getHandingMode();
                view.addObject("CreditInfohandingMode", handingMode);
                String circuitEfficiency = vo.getCircuitEfficiency();
                view.addObject("CreditInfocircuitEfficiency", circuitEfficiency);
                String fare = vo.getFare();
                view.addObject("CreditInfofare", fare);
                view.addObject("CreditInfovo", vo);

            }
            if (voAud != null && StringUtils.isNotBlank(voAud.getCircuitType())) {
                view.addObject("CircuitType", voAud.getCircuitType());
            }
            if (voAud != null && StringUtils.isNotBlank(voAud.getCargoWeigth())) {
                view.addObject("cargoWeigth", voAud.getCargoWeigth());
            }
            if (voAud != null && StringUtils.isNotBlank(voAud.getCargoVomule())) {
                view.addObject("cargoVomule", voAud.getCargoVomule());
            }
            if (voAud != null && StringUtils.isNotBlank(voAud.getHandingMode())) {
                view.addObject("HandingMode", voAud.getHandingMode());
            }
            if (voAud != null && StringUtils.isNotBlank(voAud.getCircuitEfficiency())) {
                view.addObject("circuitEfficiency", voAud.getCircuitEfficiency());
            }
            if (voAud != null && StringUtils.isNotBlank(voAud.getFare())) {
                view.addObject("fare", voAud.getFare());
            }
            List<KeyValueVO> provinceKVList = this.sysRegionService.searchProvinceKVList();
            view.addObject("provinceKVList", provinceKVList);
            //系统判断方案审核结果
            String auditInfo = prjBscInfoVO.getAuditInfo();
            if (StringUtils.isNotEmpty(auditInfo)) {
                String replaceAll = auditInfo.replaceAll(">>", "</br>");
                view.addObject("auditInfo", replaceAll);
            }

            String cstLvlCdNm = "";
            if (null != prjBscInfoVO && StringUtils.isNotEmpty(prjBscInfoVO.getCstId())) {
                String orgCd = prjBscInfoVO.getCstMgrOrgCd();
                String buOrgCd = "";
                if (orgCd != null && orgCd.length() > 8) {
                    buOrgCd = orgCd.substring(0, 8);
                }
                CstBscInfoVO cstBscInfoVO = this.cstBscInfoService.selectDetailBy(prjBscInfoVO.getCstId(), orgCd, buOrgCd);
                if (null != cstBscInfoVO) {
                    cstLvlCdNm = cstBscInfoVO.getCstLvlCdNm();
                }

            }
            view.addObject("cstLvlCdNm", cstLvlCdNm);

            //三方资管查询征信结果
            try {
                //三方资管-工行
                if (PrjBscInfoConstant.PRJ_INS_CODE_ICBC.equals(prjBscInfoVO.getInsCode())) {
                    view.addObject("icbc", "1");
                    //工行上浮比例
                    List<SysDictionaryDTO> floatPctList = this.sysDictionaryApiService.searchGroup(CurrentThreadContext.getCurrentSysCd(), CurrentThreadContext.getCurrentBuOrgCd(), DictionaryConstant.CODE__PRJ_PRD_PAY_GH_FLOAT_PCT);
                    if (CollectionUtils.isNotEmpty(floatPctList)) {
                        for (SysDictionaryDTO sysDictionaryDTO : floatPctList) {
                            if (StringUtils.isNotBlank(sysDictionaryDTO.getCodeAttr1()) && sysDictionaryDTO.getCodeAttr1().equals(String.valueOf(BaseConstant.IS_YESNO_YES))) {
                                Double floatPct = Double.valueOf(sysDictionaryDTO.getCode());
                                view.addObject("floatPct", floatPct);
                                break;
                            }
                        }
                    }
                } else {
                    view.addObject("icbc", "0");
                }
                //资管-苏宁
                if (null != prjBscInfoVO.getPrjCstAccInfoVO()) {
                    PrjCstAccInfoVO prjCstAccInfoVO = prjBscInfoVO.getPrjCstAccInfoVO();
                    view.addObject("prjCstAccNo", prjCstAccInfoVO.getAccNo());//银行账号
                    view.addObject("prjCstmp", prjCstAccInfoVO.getMp());//银行卡绑定手机号
                    view.addObject("prjCstInsAccNo", prjCstAccInfoVO.getInsAccNo());//机构户头号
                }

                String insCode = "";//三方机构标识
                if (StringUtils.isNotEmpty(prjBscInfoVO.getInsCode())) {
                    insCode = prjBscInfoVO.getInsCode();
                }
                view.addObject("insCode", insCode);

                if (null != prjBscInfoVO && StringUtils.isNotEmpty(prjBscInfoVO.getPrjTypCd()) && null != prjBscInfoVO.getFundRasInsId()) {

                    //REQ-3756 36资管机构路由 by yaoxiurong 作废第三方资管城配,第三方资管传统 新增字段IS_INS_BIZ标识是否资管业务
                    if ((null != prjBscInfoVO.getIsInsBiz() && BaseConstant.IS_YESNO_YES == prjBscInfoVO.getIsInsBiz().intValue())) {

                        //查询征信发送状态
                        InfTransLogQueryCondition itlQC = new InfTransLogQueryCondition();
                        //浙商查询条件特殊处理
                        if (PrjBscInfoConstant.PRJ_INS_CODE_ZS.equals(prjBscInfoVO.getInsCode())) {
                            itlQC.setAction(cmm.mid.core.framework.constant.tripartite.InterfaceConstants.Action.submitCredit.key());//提交征信查询
                            itlQC.setCstId(prjBscInfoVO.getCstId());//客户ID
                            itlQC.setFundRasInsId(prjBscInfoVO.getFundRasInsId());
                            itlQC.setStatus(cmm.mid.core.framework.constant.tripartite.InterfaceConstants.TransStatus.success.key());//成功状态
                        } else if (PrjBscInfoConstant.PRJ_INS_CODE_WS.equals(prjBscInfoVO.getInsCode())) {
                            //网商查询条件处理
                            itlQC.setAction(cmm.mid.core.framework.constant.tripartite.InterfaceConstants.Action.applyLoan.key());//申请贷款
                            itlQC.setPrjId(Long.valueOf(projectId));
                        } else {
                            itlQC.setAction(cmm.mid.core.framework.constant.tripartite.InterfaceConstants.Action.submitCredit.key());//提交征信查询
                            itlQC.setPrjId(Long.valueOf(projectId));
                            itlQC.setFundRasInsId(prjBscInfoVO.getFundRasInsId());
                        }
                        BaseLogUtils.newWebLogger("===查询征信发送结果Start===prjId:" + projectId + ",itlQC:" + JSON.toJSONString(itlQC)).info();
                        List<InfTransLogDTO> findTransLogs = this.transLogApi.findTransLogs(itlQC);
                        BaseLogUtils.newWebLogger("===查询征信发送结果End===prjId:" + projectId + ",findTransLogs:" + JSON.toJSONString(findTransLogs)).info();
                        String sendStatus = "";//征信发送状态
                        if (CollectionUtils.isNotEmpty(findTransLogs)) {
                            InfTransLogDTO infTransLogDTO = findTransLogs.get(0);
                            if (null != infTransLogDTO) {
                                sendStatus = infTransLogDTO.getStatus();
                            }
                        }
                        view.addObject("sendStatus", sendStatus);//同步状态 unsent-未发送  success-发送成功  failure-发送失败
                        view.addObject("sendStatusNm", this.getStatusNm(sendStatus));

                        //网商查询结果
                        String auditResult = "";
                        if ("success".equals(sendStatus) && PrjBscInfoConstant.PRJ_INS_CODE_WS.equals(prjBscInfoVO.getInsCode())) {
                            InfTransLogQueryCondition itlQCondition = new InfTransLogQueryCondition();
                            itlQCondition.setAction(cmm.mid.core.framework.constant.tripartite.InterfaceConstants.Action.queryLoan.key());//查询贷款
                            itlQCondition.setPrjId(Long.valueOf(projectId));
                            BaseLogUtils.newWebLogger("= transLogApi.findTransLogs 查询审核结果Start=prjId:" + projectId + ",itlQCondition:" + JSON.toJSONString(itlQCondition)).info();
                            List<InfTransLogDTO> findTransLogsRst = this.transLogApi.findTransLogs(itlQCondition);
                            BaseLogUtils.newWebLogger("= transLogApi.findTransLogs 查询审核结果End=prjId:" + projectId + ",findTransLogsRst:" + JSON.toJSONString(findTransLogsRst)).info();
                            if (CollectionUtils.isNotEmpty(findTransLogsRst)) {
                                InfTransLogDTO infTransLogDTO = findTransLogsRst.get(0);
                                if (null != infTransLogDTO) {
                                    auditResult = infTransLogDTO.getRespCode();
                                }
                            }
                        }
                        view.addObject("auditResult", auditResult);//审核结果
                        view.addObject("auditDesc", "");//审核描述

                        //浙商查询结果     因为浙商没有客户信息审核结果,为了保证上线时间,这里先不做查询
                        if ("success".equals(sendStatus) && PrjBscInfoConstant.PRJ_INS_CODE_ZS.equals(prjBscInfoVO.getInsCode())) {
                            view.addObject("auditResult", "pass");//审核结果
                            view.addObject("auditDesc", "");//审核描述
                        }

                        //工行/中建投 查询结果
                        if ("success".equals(sendStatus) &&
                                (PrjBscInfoConstant.PRJ_INS_CODE_JIC.equals(prjBscInfoVO.getInsCode())
                                        || PrjBscInfoConstant.PRJ_INS_CODE_ICBC.equals(prjBscInfoVO.getInsCode()))) {
                            PrjPrdPaySchMQueryCondition pppsmQC = new PrjPrdPaySchMQueryCondition();
                            pppsmQC.setPrjId(Long.valueOf(projectId));
                            pppsmQC.setPaySchTypCd(PrjPrdPaySchMConstant.PAY_SCH_TYP_CD_WS);
                            BaseLogUtils.newWebLogger("===查询支付表信息Start===prjId:" + projectId).info();
                            List<PrjPrdPaySchMVO> prjPrdPaySchMVOList = this.prjPrdPaySchMService.searchList(pppsmQC);
                            BaseLogUtils.newWebLogger("===查询支付表信息End===prjId:" + projectId + ",prjPrdPaySchMVOList:" + JSON.toJSONString(prjPrdPaySchMVOList)).info();
                            if (CollectionUtils.isNotEmpty(prjPrdPaySchMVOList)) {
                                List<Long> exclusivePrjPaySchIds = new ArrayList<Long>();
                                //过滤掉上装支付表
                                PrjPrdBscInfoQueryCondition ppbiQC = new PrjPrdBscInfoQueryCondition();
                                ppbiQC.setPrjId(Long.valueOf(projectId));
                                BaseLogUtils.newWebLogger("=查询项目产品信息Start=prjId:" + projectId).info();
                                List<PrjPrdBscInfoVO> prjPrdBscInfoVOList = this.prjPrdBscInfoService.searchList(ppbiQC);
                                BaseLogUtils.newWebLogger("=查询项目产品信息End=prjId:" + projectId + ",prjPrdBscInfoVOList:" + JSON.toJSONString(prjPrdBscInfoVOList)).info();
                                List<Long> exclusivePrjPrdIds = new ArrayList<Long>();
                                if (CollectionUtils.isNotEmpty(prjPrdBscInfoVOList)) {
                                    for (PrjPrdBscInfoVO prjPrdBscInfoVO : prjPrdBscInfoVOList) {
                                        if (CarStyleConstant.PRD_TYP_8.equals(prjPrdBscInfoVO.getPrdTypCd())) {
                                            exclusivePrjPrdIds.add(prjPrdBscInfoVO.getId());
                                        }
                                    }
                                }
                                PrjPrdDtlQueryCondition ppdQC = new PrjPrdDtlQueryCondition();
                                ppdQC.setPrjId(Long.valueOf(projectId));
                                BaseLogUtils.newWebLogger("=查询项目产品明细Start=prjId:" + projectId).info();
                                List<PrjPrdDtlVO> prjPrdDtlVOList = this.prjPrdDtlService.selectList(ppdQC);
                                BaseLogUtils.newWebLogger("=查询项目产品明细End=prjId:" + projectId + ",prjPrdDtlDTOList:" + JSON.toJSONString(prjPrdDtlVOList)).info();
                                if (CollectionUtils.isNotEmpty(prjPrdDtlVOList)) {
                                    for (PrjPrdDtlVO prjPrdDtlVO : prjPrdDtlVOList) {
                                        if (exclusivePrjPrdIds.contains(prjPrdDtlVO.getPrjPrdId())) {
                                            exclusivePrjPaySchIds.add(prjPrdDtlVO.getPaySchId());
                                        }
                                    }
                                }
                                List<Long> paySchIds = new ArrayList<Long>();
                                for (PrjPrdPaySchMVO prjPrdPaySchMVO : prjPrdPaySchMVOList) {
                                    if (exclusivePrjPaySchIds.contains(prjPrdPaySchMVO.getId())) {
                                        continue;
                                    }
                                    paySchIds.add(prjPrdPaySchMVO.getId());
                                }
                                BaseLogUtils.newWebLogger("===查询征信请求结果Start===prjId:" + projectId + ",insId:" + prjBscInfoVO.getFundRasInsId() + ",insCd:" + prjBscInfoVO.getInsCode() + ",paySchIds:" + JSON.toJSONString(paySchIds)).info();
                                cmm.mid.core.framework.dto.MessageDTO<CreditDTO> queryCredit = this.tripartiteApi.queryCredit(prjBscInfoVO.getFundRasInsId(), prjBscInfoVO.getInsCode(), prjBscInfoVO.getId(), paySchIds);
                                BaseLogUtils.newWebLogger("===查询征信请求结果End===prjId:" + projectId + ",queryCredit:" + JSON.toJSONString(queryCredit)).info();
                                if (null != queryCredit && queryCredit.isSuccess()) {
                                    CreditDTO creditDTO = queryCredit.getData();
                                    if (null != creditDTO) {
                                        view.addObject("auditResult", creditDTO.getAuditResult());//审核结果
                                        view.addObject("auditDesc", creditDTO.getAuditDesc());//审核描述
                                    }
                                }
                            }
                        }
                    }
                }

                //风险标记开始
                List<Long> prjPrdDtlIdList = new ArrayList<Long>();
                PrjPrdDtlQueryCondition dtlQC = new PrjPrdDtlQueryCondition();
                dtlQC.setPrjId(Long.valueOf(projectId));
                List<PrjPrdDtlVO> dtlList = this.prjPrdDtlService.selectList(dtlQC);
                if (CollectionUtils.isNotEmpty(dtlList)) {
                    for (PrjPrdDtlVO dtl : dtlList) {
                        if (!prjPrdDtlIdList.contains(dtl.getId())) {
                            prjPrdDtlIdList.add(dtl.getId());
                        }
                    }
                }
                Map<String, String> result = this.rskCstSignLogService.searchRskResInfo(prjBscInfoVO.getCstId(), Long.valueOf(projectId), prjPrdDtlIdList);
                if (MapUtils.isNotEmpty(result)) {
                    view.addObject("rskCstSignDesc", result.get("rskCstSignDesc"));//客户风险标记
                    view.addObject("rskProdSignDesc", result.get("rskProdSignDesc"));//设备风险标记
                    view.addObject("rskGuarSignDesc", result.get("rskGuarSignDesc"));//担保人风险标记
                } else {
                    view.addObject("rskCstSignDesc", "");//客户风险标记
                    view.addObject("rskProdSignDesc", "");//设备风险标记
                    view.addObject("rskGuarSignDesc", "");//担保人风险标记
                }
            } catch (Exception e) {
                BaseLogUtils.newWebLogger("===查询征信异常===prjId:" + projectId).info();
                e.printStackTrace();
            }

            //查询项目产品信息 取产品类型传到页面 刷新车辆运营动态字段
            String prdTypCd = "";
            PrjPrdBscInfoQueryCondition prjPrdQc = new PrjPrdBscInfoQueryCondition();
            if (StringUtils.isNotEmpty(projectId)) {
                prjPrdQc.setPrjId(Long.valueOf(projectId));
            }
            List<PrjPrdBscInfoVO> prjPrdBscInfoVOList = this.prjPrdBscInfoService.searchList(prjPrdQc);

            //查询项目产品明细
            PrjPrdDtlQueryCondition condition = new PrjPrdDtlQueryCondition();
            if (StringUtils.isNotEmpty(projectId)) {
                condition.setPrjId(Long.valueOf(projectId));
            }
            List<PrjPrdDtlVO> prjPrdDtlVOList = this.prjPrdDtlService.selectList(condition);
            List<String> styleIdList = new ArrayList();//车辆型号
            List<Long> lnkCompNmList = new ArrayList();//挂靠公司名称
            if (CollectionUtils.isNotEmpty(prjPrdBscInfoVOList)) {
                for (PrjPrdDtlVO prjPrdDtlVO : prjPrdDtlVOList) {
                    String prdMdl = prjPrdDtlVO.getPrdMdl();
                    if (CollectionUtils.isEmpty(styleIdList) || (!styleIdList.contains(prdMdl))) {
                        styleIdList.add(prdMdl);
                    }
                    if (StringUtils.isNotEmpty(prjPrdDtlVO.getLnkCompId())) {
                        Long lnkCompId = prjPrdDtlVO.getLnkCompId();
                        if (CollectionUtils.isEmpty(lnkCompNmList) || (!lnkCompNmList.contains(lnkCompId))) {
                            lnkCompNmList.add(lnkCompId);
                        }
                    } else if (StringUtils.isEmpty(prjPrdDtlVO.getLnkCompId()) && (!lnkCompNmList.contains(0L))) {
                        lnkCompNmList.add(0L);
                    }
                }
            }

            if (CollectionUtils.isNotEmpty(prjPrdBscInfoVOList)) {
                prdTypCd = prjPrdBscInfoVOList.get(0).getPrdTypCd();
                // prjPrdDtlList = prjPrdBscInfoVOList.get(0).getPrjPrdDtlList();    // 产品明细
            }
            boolean styleIds = styleIdList.size() > 1;
            boolean lnkCompNms = lnkCompNmList.size() > 1;
            view.addObject("prdTypCd", prdTypCd);
            view.addObject("styleIds", styleIds);
            view.addObject("lnkCompNms", lnkCompNms);

            /** REQ-3674 上牌 抵押信息 (车抵贷（线下）、二手车交易贷) start */
			/*if(prjBscInfoVO.getPrjTypCd()!=null && ("CDDYWUL".equals(prjBscInfoVO.getPrjTypCd()) || "ESCJYD".equals(prjBscInfoVO.getPrjTypCd()))){
				//2017-3-31 String escFlag = "0";
				String escFlag = "1";
				PrjPrdDtlQueryCondition prjPrdDtlQc = new PrjPrdDtlQueryCondition();
				if(StringUtils.isNotEmpty(projectId)){
					prjPrdDtlQc.setPrjId(Long.valueOf(projectId));
				}
				List<PrjPrdDtlVO> prjPrdDtlVOs = this.prjPrdDtlService.selectList(prjPrdDtlQc);
				if(prjPrdDtlVOs != null && CollectionUtils.isNotEmpty(prjPrdDtlVOs)) {
					List<Map<String, Object>> prjPrdLicInfoList = new ArrayList<>();
					for (PrjPrdDtlVO prjPrdDtlVO : prjPrdDtlVOs) {
						Map<String, Object> prjPrdLicInfoView = new HashMap<>();
						Long prjPrdDtlId = prjPrdDtlVO.getId();
						String isExistSp = "";
						String spState = "0";
						if(StringUtils.isNotEmpty(prjPrdDtlId)){
							prjPrdLicInfoView.put("prjPrdDtlId", prjPrdDtlId); // 项目产品信息id
							//查询上牌信息
							BaseLogUtils.newWebLogger("===查询上牌信息Start===prjPrdDtlId:"+prjPrdDtlId);
							PrjPrdLicInfoVO prjPrdLicInfoVO = this.prjPrdLicInfoService.selectById(prjPrdDtlId);
							BaseLogUtils.newWebLogger("===查询上牌信息End===prjPrdDtlId:"+prjPrdDtlId+",prjPrdLicInfoVO:"+JSON.toJSONString(prjPrdLicInfoVO));
							if(null==prjPrdLicInfoVO){
								isExistSp = "0";
							}else{
								isExistSp = "1";
							}
							if(null!=prjPrdLicInfoVO && FlowConstant.FLOW_CHECK_STATE_PASS.equals(prjPrdLicInfoVO.getAudStsCd())){
								spState = "1";
							}
                            prjPrdLicInfoView.put("vehNo", prjPrdLicInfoVO.getVehNo()); // 车牌号
						}
						prjPrdLicInfoView.put("spState", spState);			// 是否已上牌 1已上牌
						prjPrdLicInfoView.put("isExistSp", isExistSp);		// 是否存在上牌信息 1存在
						String dyFlag = request.getParameter("dyFlag"); //抵押
						if(StringUtils.isNotEmpty(dyFlag)){
							dyFlag = dyFlag.replace("\'", "");
						}else{
							dyFlag = "0";
						}

						String isExistDy = "";
						String dyState = "0";
						if(StringUtils.isNotEmpty(prjPrdDtlId)){
							//查询抵押信息
							BaseLogUtils.newWebLogger("===查询抵押信息Start===prjPrdDtlId:"+prjPrdDtlId);
							PrjPrdMtgVO prjPrdMtgVO = this.prjPrdMtgService.selectById(prjPrdDtlId);
							BaseLogUtils.newWebLogger("===查询抵押信息End===prjPrdDtlId:"+prjPrdDtlId+",prjPrdMtgVO:"+JSON.toJSONString(prjPrdMtgVO));
							if(null==prjPrdMtgVO){
								isExistDy = "0";
							}else{
								isExistDy = "1";
							}
							if(null!=prjPrdMtgVO && PrjPrdMtgConstant.CODE_GUAR_STS_CD_MTG.equals(prjPrdMtgVO.getGuarStsCd())){
								dyState = "1";
							}
                            prjPrdLicInfoView.put("recNo", prjPrdMtgVO.getRecNo()); // REC_NO
						}
						prjPrdLicInfoView.put("dyState", dyState);  	// 是否已抵押 1 已抵押
						prjPrdLicInfoView.put("dyFlag", dyFlag);    	// 查看/编辑  0/1
						prjPrdLicInfoView.put("isExistDy", isExistDy);	// 是否存在抵押信息 1 存在
						prjPrdLicInfoList.add(prjPrdLicInfoView);
					}
					view.addObject("prjPrdLicInfoList", prjPrdLicInfoList);
					view.addObject("escFlag", escFlag);  // 显示抵押信息开关 1显示
				}
			}*/
            /** 上牌 抵押信息   end */

            //根据所查到的产品类型 查询映射表配置 获得哪些产品类型有数据需要实例化
            List<String> tCodeList = new ArrayList<String>();
            if (CollectionUtils.isNotEmpty(prjPrdBscInfoVOList)) {
                List<String> sCodeList = new ArrayList<String>();
                for (PrjPrdBscInfoVO prjPrdBscInfoVO : prjPrdBscInfoVOList) {
                    if (!sCodeList.contains(prjPrdBscInfoVO.getPrdTypCd())) {
                        sCodeList.add(prjPrdBscInfoVO.getPrdTypCd());
                    }
                }
                if (CollectionUtils.isNotEmpty(sCodeList)) {
                    SysCdMapDQueryCondition cdMapDQC = new SysCdMapDQueryCondition();
                    cdMapDQC.setSysCd(CurrentThreadContext.getCurrentSysCd());
                    cdMapDQC.setOrgCd(CurrentThreadContext.getCurrentOrgCd());
                    cdMapDQC.setmTypCd("M2006");
                    cdMapDQC.setsCodeList(sCodeList);
                    List<SysCdMapDDTO> sysCdMapDList = this.sysCdMapApiService.searchSysCdMapDWithTargetList(cdMapDQC);
                    if (CollectionUtils.isNotEmpty(sysCdMapDList)) {
                        for (SysCdMapDDTO sysCdMapDDTO : sysCdMapDList) {
                            if (!tCodeList.contains(sysCdMapDDTO.getTCode())) {
                                tCodeList.add(sysCdMapDDTO.getTCode());
                            }
                        }
                    }
                }
            }
            StringBuffer tCodeString = new StringBuffer();
            if (CollectionUtils.isNotEmpty(tCodeList)) {
                for (String string : tCodeList) {
                    tCodeString.append(string + ";");
                }
                view.addObject("tCodeString", tCodeString.substring(0, tCodeString.length() - 1).toString());
            }

            //设备大类
            List<KeyValueVO> equCategoryCdList = this.prjBscInfoService.searchEquCategoryCdList(CurrentThreadContext.getCurrentSysCd(), prjBscInfoVO.getBuOrgCd());
            view.addObject("equCategoryCdListJSON", JSON.toJSONString(equCategoryCdList));
            //放款方式
            List<KeyValueVO> payWayCdList = this.prjBscInfoService.searchPayWayCdList(CurrentThreadContext.getCurrentSysCd(), prjBscInfoVO.getBuOrgCd());
            view.addObject("payWayCdListJSON", JSON.toJSONString(payWayCdList));
            //车辆级别
            List<KeyValueVO> carLevelCdList = this.prjBscInfoService.searchCarLevelCdList();
            view.addObject("carLevelCdListJSON", JSON.toJSON(carLevelCdList));
            //农机设备大类
            List<KeyValueVO> farmEquCategoryCdList = this.prjBscInfoService.searchFarmEquCategoryCdList();
            view.addObject("farmEquCategoryCdListJSON", JSON.toJSON(farmEquCategoryCdList));

            //收入方式
            List<KeyValueVO> profitCdList = this.audReturnVisitService.searchProfitCdList(CurrentThreadContext.getCurrentSysCd(), prjBscInfoVO.getBuOrgCd());
            view.addObject("profitCdList", profitCdList);
            //运营年限/本地生活年限
            List<KeyValueVO> bizExpList = this.audReturnVisitService.searchBizExpList();
            view.addObject("bizExpList", bizExpList);
            //主货物大类
            List<KeyValueVO> mainGdsTypCdList = this.audCreditInfoService.searchGoodsTypListByLvl("1");
            view.addObject("mainGdsTypCdList", mainGdsTypCdList);
            //货物来源
            List<KeyValueVO> goodsResList = this.audReturnVisitService.searchGoodsResList();
            view.addObject("goodsResList", goodsResList);
            //主货物结算方式
            List<KeyValueVO> gdsStlWayCdList = this.audReturnVisitService.searchGdsStlWayCdList();
            view.addObject("gdsStlWayCdList", gdsStlWayCdList);
            //司机情况
            List<KeyValueVO> driverList = this.audReturnVisitService.searchDriverList();
            view.addObject("driverList", driverList);
            //第二还款来源
            List<KeyValueVO> secondPayResCdList = this.audReturnVisitService.searchSecondPayResCdList();
            view.addObject("secondPayResCdList", secondPayResCdList);

            //是否
            List<KeyValueVO> yesOrNoCdList = this.audStandingBookService.searchYesOrNoCdList();
            view.addObject("yesOrNoCdList", yesOrNoCdList);
            //流程审核意见
            List<KeyValueVO> processOpinionCdList = this.audStandingBookService.searchProcessOpinionCdList();
            view.addObject("processOpinionCdList", processOpinionCdList);
            //客户经理评级
            List<KeyValueVO> cstMgrLvlCdList = this.audInterviewInfoService.searchCstMgrLvlCdList();
            view.addObject("cstMgrLvlCdList", cstMgrLvlCdList);
            //首付款来源
            List<KeyValueVO> firstPayResCdList = this.audInterviewInfoService.searchFirstPayResCdList();
            view.addObject("firstPayResCdList", firstPayResCdList);
            //风控评级
            List<KeyValueVO> riskCtrlLvlCdList = this.audInterviewInfoService.searchRiskCtrlLvlCdList();
            view.addObject("riskCtrlLvlCdList", riskCtrlLvlCdList);
            //是否团单
            List<KeyValueVO> isGrpList = this.capPayInfoService.searchIsGrpList();
            view.addObject("isGrpList", isGrpList);
            //风险提示
            List<KeyValueVO> riskTipsList = sysDictionaryApiService.getKvList(PrjMapRiskConstant.MAP_RISK_TIPS_CD, CurrentThreadContext.getCurrentSysCd(), CurrentThreadContext.getCurrentOrgCd());
            view.addObject("riskTipsList", JSONArray.fromObject(riskTipsList));
            //客户评级-经验
            List<KeyValueVO> experienceCdList = this.sysDictionaryApiService.getKvList(AudStandingBookConstant.EXPERIENCE_CD, CurrentThreadContext.getCurrentSysCd(), CurrentThreadContext.getCurrentOrgCd());
            view.addObject("experienceCdList", experienceCdList);
            //客户评级-货源
            List<KeyValueVO> goodsSourceCdList = this.sysDictionaryApiService.getKvList(AudStandingBookConstant.GOODS_SOURCE_CD, CurrentThreadContext.getCurrentSysCd(), CurrentThreadContext.getCurrentOrgCd());
            view.addObject("goodsSourceCdList", goodsSourceCdList);
            //拆单/顶名嫌疑
            List<KeyValueVO> suspicionCdList = this.sysDictionaryApiService.getKvList(AudStandingBookConstant.SUSPICION_CD, CurrentThreadContext.getCurrentSysCd(), CurrentThreadContext.getCurrentOrgCd());
            view.addObject("suspicionCdList", suspicionCdList);
            //还款能力
            List<KeyValueVO> repaymentCapacityCdList = this.sysDictionaryApiService.getKvList(AudStandingBookConstant.REPAYMENT_CAPACITY_CD, CurrentThreadContext.getCurrentSysCd(), CurrentThreadContext.getCurrentOrgCd());
            view.addObject("repaymentCapacityCdList", repaymentCapacityCdList);
            //配合度
            List<KeyValueVO> complianceCdList = this.sysDictionaryApiService.getKvList(AudStandingBookConstant.COMPLIANCE_CD, CurrentThreadContext.getCurrentSysCd(), CurrentThreadContext.getCurrentOrgCd());
            view.addObject("complianceCdList", complianceCdList);
            /**
             * 判断是否信审节点
             * 判断签收标识
             * 查询是否已经发送过短信给承租人(根据流程实例ID和模板Code查询)
             */
            try {
                if (StringUtils.isNotEmpty(isDetail) && String.valueOf(BaseConstant.IS_YESNO_NO).equals(isDetail)) {
                    String isSign = request.getParameter("isSign");
                    if (StringUtils.isNotEmpty(isSign) && String.valueOf(BaseConstant.IS_YESNO_YES).equals(isSign)) {
                        SysSmsLogQueryCondition qc = new SysSmsLogQueryCondition();
                        qc.setTemplatesCode(SysConTemplatesConstant.SMS_CREDIT_AUDIT_SIGN);
                        qc.setCustomField(proIntId);
                        BaseLogUtils.newWebLogger("===查询发送短信日志Start===qc:" + JSON.toJSONString(qc)).info();
                        List<SysSmsLogDTO> sysSmsLogList = this.sysSmsApiService.searchSysSmsLogList(qc);
                        BaseLogUtils.newWebLogger("===查询发送短信日志End===sysSmsLogList:" + JSON.toJSONString(sysSmsLogList)).info();
                        if (CollectionUtils.isEmpty(sysSmsLogList)) {
                            if (null != prjBscInfoVO) {
                                String cstNm = prjBscInfoVO.getCstNm();//客户名称
                                Long cstId = prjBscInfoVO.getCstId();
                                String cstMp = "";//客户手机号
                                if (StringUtils.isNotEmpty(cstId)) {
                                    CstNpBscInfoQueryCondition npQC = new CstNpBscInfoQueryCondition();
                                    List<Long> cstIdList = new ArrayList<Long>();
                                    cstIdList.add(cstId);
                                    npQC.setIdList(cstIdList);
                                    BaseLogUtils.newWebLogger("===查询自然人客户信息Start===npQC:" + JSON.toJSONString(npQC)).info();
                                    List<CstNpBscInfoDTO> cstNpBscInfoList = this.customerQueryApiService.searchCstNpBscInfoList(npQC);
                                    BaseLogUtils.newWebLogger("===查询自然人客户信息End===cstNpBscInfoList:" + JSON.toJSONString(cstNpBscInfoList)).info();
                                    if (CollectionUtils.isNotEmpty(cstNpBscInfoList)) {
                                        CstNpBscInfoDTO cstNpBscInfoDTO = cstNpBscInfoList.get(0);
                                        if (null != cstNpBscInfoDTO) {
                                            String mp1 = cstNpBscInfoDTO.getMp1();
                                            String mp2 = cstNpBscInfoDTO.getMp2();
                                            if (StringUtils.isNotEmpty(mp1)) {
                                                cstMp = mp1;
                                            } else if (StringUtils.isNotEmpty(mp2)) {
                                                cstMp = mp2;
                                            }
                                        }
                                    }
                                }
                                //发送短信
                                if (StringUtils.isNotEmpty(cstMp) && StringUtils.isNotEmpty(cstNm)) {
                                    Map<String, String> contextParams = new HashMap<String, String>();//短信内容参数
                                    contextParams.put("客户姓名", cstNm);
                                    //发送短信对象
                                    SendContextDTO sendContextDTO = new SendContextDTO();
                                    sendContextDTO.setPhone(cstMp);
                                    sendContextDTO.setTemplatesCode(SysConTemplatesConstant.SMS_CREDIT_AUDIT_SIGN);
                                    sendContextDTO.setContextParams(contextParams);
                                    sendContextDTO.setCreateId(CurrentThreadContext.getCurrentUserId());
                                    sendContextDTO.setCreateName(CurrentThreadContext.getCurrentUserName());
                                    sendContextDTO.setCreateDate(new Date());
                                    sendContextDTO.setCustomField(proIntId);
                                    BaseLogUtils.newWebLogger("===发送短信Start===sendContextDTO:" + JSON.toJSONString(sendContextDTO)).info();
                                    DataResultDTO sendSmsResultDTO = this.sysSmsApiService.sendSms(sendContextDTO);
                                    BaseLogUtils.newWebLogger("===发送短信End===sendSmsResultDTO:" + JSON.toJSONString(sendSmsResultDTO)).info();
                                }
                            }
                        }
                    }
                    //发短信给客户经理
                    if (StringUtils.isNotEmpty(isSign) && String.valueOf(BaseConstant.IS_YESNO_YES).equals(isSign)) {
                        SysSmsLogQueryCondition qc = new SysSmsLogQueryCondition();
                        qc.setTemplatesCode(SysConTemplatesConstant.SMS_CREDIT_AUDIT_SIGN_MGR);
                        qc.setCustomField(proIntId);
                        BaseLogUtils.newWebLogger("===查询发送短信日志Start===qc:" + JSON.toJSONString(qc)).info();
                        List<SysSmsLogDTO> sysSmsLogList = this.sysSmsApiService.searchSysSmsLogList(qc);
                        BaseLogUtils.newWebLogger("===查询发送短信日志End===sysSmsLogList:" + JSON.toJSONString(sysSmsLogList)).info();
                        if (CollectionUtils.isEmpty(sysSmsLogList)) {
                            if (null != prjBscInfoVO) {
                                String cstNm = prjBscInfoVO.getCstNm();//客户名称
                                String cstMgrNm = prjBscInfoVO.getCstMgrNm();//客户经理名称
                                //发送短信
                                if (StringUtils.isNotEmpty(mp) && StringUtils.isNotEmpty(cstMgrNm) && StringUtils.isNotEmpty(cstNm) && StringUtils.isNotEmpty(taskNm)) {
                                    Map<String, String> contextParams = new HashMap<String, String>();//短信内容参数
                                    contextParams.put("客户经理名称", cstMgrNm);
                                    contextParams.put("客户名称", cstNm);
                                    contextParams.put("节点名称", taskNm);
                                    //发送短信对象
                                    SendContextDTO sendContextDTO = new SendContextDTO();
                                    sendContextDTO.setPhone(mp);
                                    sendContextDTO.setTemplatesCode(SysConTemplatesConstant.SMS_CREDIT_AUDIT_SIGN_MGR);
                                    sendContextDTO.setContextParams(contextParams);
                                    sendContextDTO.setCreateId(CurrentThreadContext.getCurrentUserId());
                                    sendContextDTO.setCreateName(CurrentThreadContext.getCurrentUserName());
                                    sendContextDTO.setCreateDate(new Date());
                                    sendContextDTO.setCustomField(proIntId);
                                    BaseLogUtils.newWebLogger("===发送短信Start===sendContextDTO:" + JSON.toJSONString(sendContextDTO)).info();
                                    DataResultDTO sendSmsResultDTO = this.sysSmsApiService.sendSms(sendContextDTO);
                                    BaseLogUtils.newWebLogger("===发送短信End===sendSmsResultDTO:" + JSON.toJSONString(sendSmsResultDTO)).info();
                                }
                            }
                        }
                    }
                }
            } catch (Exception e) {
                BaseLogUtils.newWebLogger("===发送短信失败===Detail:" + e.getMessage()).setThrowable(e).error(LogExceptionEnum.COMMON_CODE_0002);
            }
            //厂商业务方案政策列表
            List<KeyValueVO> policyTypCdList = this.sysDictionaryApiService.getKvList(DictionaryConstant.CODE_QUAT_POLICY_TYP_CD, CurrentThreadContext.getCurrentSysCd(), CurrentThreadContext.getCurrentOrgCd());
            view.addObject("policyTypCdList", policyTypCdList);
        } catch (Exception e) {
            BaseLogUtils.newWebLogger("=跳转流程附加信息页面异常=projectId:" + projectId + "," + e.getMessage()).setThrowable(e).error(LogExceptionEnum.COMMON_CODE_0002);
            e.printStackTrace();
        }
        return view;
    }

    private String getStatusNm(String status) {
        if (StringUtils.isNotEmpty(status)) {
            if (cmm.mid.core.framework.constant.tripartite.InterfaceConstants.TransStatus.unsent.key().equals(status)) {
                return cmm.mid.core.framework.constant.tripartite.InterfaceConstants.TransStatus.unsent.desc();
            } else if (cmm.mid.core.framework.constant.tripartite.InterfaceConstants.TransStatus.failure.key().equals(status)) {
                return cmm.mid.core.framework.constant.tripartite.InterfaceConstants.TransStatus.failure.desc();
            } else if (cmm.mid.core.framework.constant.tripartite.InterfaceConstants.TransStatus.success.key().equals(status)) {
                return cmm.mid.core.framework.constant.tripartite.InterfaceConstants.TransStatus.success.desc();
            } else if ("0".equals(status)) {
                return "等待处理";
            } else if ("1".equals(status)) {
                return "查询通过";
            } else if ("2".equals(status)) {
                return "查询不通过";
            } else if ("3".equals(status)) {
                return "放弃查询";
            } else if ("9".equals(status)) {
                return "未知错误，请联系系统管理员确认";
            } else {
                return "无";
            }
        } else {
            return "无";
        }
    }


}
